Mercurial > mm7
annotate SpriteObject.cpp @ 2463:0f17a30149ec
cleaning project part 1
author | zipi |
---|---|
date | Sun, 17 Aug 2014 15:13:18 +0100 |
parents | f4af3b203f65 |
children | 104fdbea0386 |
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 |
2463 | 29 #include "stru298.h" |
30 #include "Random.h" | |
31 | |
828
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 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
35 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
36 |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
37 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
38 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
39 size_t uNumSpriteObjects; |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1205
diff
changeset
|
40 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
|
41 |
781 | 42 //----- (00404828) -------------------------------------------------------- |
43 SpriteObject::SpriteObject() | |
44 { | |
45 field_22_glow_radius_multiplier = 1; | |
46 uSoundID = 0; | |
47 uFacing = 0; | |
48 vVelocity.z = 0; | |
49 vVelocity.y = 0; | |
50 vVelocity.x = 0; | |
51 uType = 0; | |
52 uObjectDescID = 0; | |
53 field_61 = 0; | |
54 field_60_distance_related_prolly_lod = 0; | |
55 field_20 = 0; | |
56 uSpriteFrameID = 0; | |
822 | 57 spell_skill = 0; |
58 spell_level = 0; | |
59 spell_id = 0; | |
781 | 60 field_54 = 0; |
61 } | |
515
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 //----- (0042F5ED) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
64 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
|
65 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
66 signed int v6; // ebx@2 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
67 int v13; // ST2C_4@20 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
68 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
|
69 int angle; // [sp+Ch] [bp-4h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
70 int a5a; // [sp+20h] [bp+10h]@20 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
71 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
72 angle = yaw; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
73 if (!uObjectDescID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
74 return -1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
75 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
76 v6 = 1000; |
810 | 77 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
|
78 if (!pSpriteObjects[i].uObjectDescID) |
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 v6 = i; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
81 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
82 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
83 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
84 if ( v6 >= 1000 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
85 return -1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
86 field_64.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
87 field_64.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
88 field_64.z = vPosition.z; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
89 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
90 assert(sizeof(SpriteObject) == 0x70); |
1406 | 91 memcpy(&pSpriteObjects[v6], this, sizeof(*this)); |
92 if ( a5 == 0 ) | |
93 { | |
94 pSpriteObjects[v6].vVelocity.z = 0; | |
95 if ( a4 ) | |
96 { | |
1643 | 97 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
98 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
99 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
100 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
101 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 102 } |
103 else | |
104 { | |
105 pSpriteObjects[v6].vVelocity.y = 0; | |
106 pSpriteObjects[v6].vVelocity.x = 0; | |
107 } | |
108 if ( v6 >= (signed int)uNumSpriteObjects ) | |
109 uNumSpriteObjects = v6 + 1; | |
110 return v6; | |
111 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
112 if ( a5 == 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
113 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
114 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
115 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
116 v17.z = vPosition.z; |
1406 | 117 Vec3_int_::Rotate(24, stru_5C6E00->uIntegerHalfPi + pSpriteObjects[v6].uFacing, 0, v17, &pSpriteObjects[v6].vPosition.x, |
118 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
119 pSpriteObjects[v6].vVelocity.z = 0; | |
120 if ( a4 ) | |
121 { | |
1643 | 122 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
123 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
124 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
125 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
126 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 127 } |
128 else | |
129 { | |
130 pSpriteObjects[v6].vVelocity.y = 0; | |
131 pSpriteObjects[v6].vVelocity.x = 0; | |
132 } | |
133 if ( v6 >= (signed int)uNumSpriteObjects ) | |
134 uNumSpriteObjects = v6 + 1; | |
135 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
136 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
137 if ( a5 == 2 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
138 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
139 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
140 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
141 v17.z = vPosition.z; |
1406 | 142 Vec3_int_::Rotate(8, stru_5C6E00->uIntegerHalfPi + pSpriteObjects[v6].uFacing, 0, v17, &pSpriteObjects[v6].vPosition.x, |
143 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
144 pSpriteObjects[v6].vVelocity.z = 0; | |
145 if ( a4 ) | |
146 { | |
1643 | 147 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)) >> 16; |
148 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)) >> 16; | |
149 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
150 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
151 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 152 } |
153 else | |
154 { | |
155 pSpriteObjects[v6].vVelocity.y = 0; | |
156 pSpriteObjects[v6].vVelocity.x = 0; | |
157 } | |
158 if ( v6 >= (signed int)uNumSpriteObjects ) | |
159 uNumSpriteObjects = v6 + 1; | |
160 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
161 } |
1406 | 162 if ( a5 == 3 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
163 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
164 v17.x = vPosition.x; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
165 v17.y = vPosition.y; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
166 v17.z = vPosition.z; |
1406 | 167 Vec3_int_::Rotate(8, pSpriteObjects[v6].uFacing - stru_5C6E00->uIntegerHalfPi, 0, v17, &pSpriteObjects[v6].vPosition.x, |
168 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
169 pSpriteObjects[v6].vVelocity.z = 0; | |
170 if ( a4 ) | |
171 { | |
1643 | 172 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
173 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
174 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
175 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
176 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 177 } |
178 else | |
179 { | |
180 pSpriteObjects[v6].vVelocity.y = 0; | |
181 pSpriteObjects[v6].vVelocity.x = 0; | |
182 } | |
183 if ( v6 >= (signed int)uNumSpriteObjects ) | |
184 uNumSpriteObjects = v6 + 1; | |
185 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
186 } |
1406 | 187 if ( a5 == 4 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
188 { |
1406 | 189 v17.x = vPosition.x; |
190 v17.y = vPosition.y; | |
191 v17.z = vPosition.z; | |
192 Vec3_int_::Rotate(24, pSpriteObjects[v6].uFacing - stru_5C6E00->uIntegerHalfPi, 0, v17, &pSpriteObjects[v6].vPosition.x, | |
193 &pSpriteObjects[v6].vPosition.y, &pSpriteObjects[v6].vPosition.z); | |
194 pSpriteObjects[v6].vVelocity.z = 0; | |
195 if ( a4 ) | |
196 { | |
1643 | 197 v13 = fixpoint_mul(stru_5C6E00->Cos(angle), stru_5C6E00->Cos(pitch)); |
198 a5a = fixpoint_mul(stru_5C6E00->Sin(angle), stru_5C6E00->Cos(pitch)); | |
199 pSpriteObjects[v6].vVelocity.x = fixpoint_mul(v13, a4); | |
200 pSpriteObjects[v6].vVelocity.y = fixpoint_mul(a5a, a4); | |
201 pSpriteObjects[v6].vVelocity.z = fixpoint_mul(stru_5C6E00->Sin(pitch), a4); | |
1406 | 202 } |
203 else | |
204 { | |
205 pSpriteObjects[v6].vVelocity.y = 0; | |
206 pSpriteObjects[v6].vVelocity.x = 0; | |
207 } | |
208 if ( v6 >= (signed int)uNumSpriteObjects ) | |
209 uNumSpriteObjects = v6 + 1; | |
210 return v6; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
211 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
212 |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
213 assert(false); |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1406
diff
changeset
|
214 return 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
215 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
216 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
217 //----- (00471C03) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
218 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
|
219 { |
2068 | 220 ObjectDesc *object; // ebx@1 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
221 int v6; // eax@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
222 int v7; // ecx@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
223 int v8; // edi@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
224 int v9; // eax@4 |
2334 | 225 // int v17; // ST10_4@25 |
2085 | 226 //signed int v19; // eax@28 |
227 //Actor *v20; // edi@31 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
228 int v21; // eax@41 |
2334 | 229 // int v22; // ecx@43 |
230 // __int16 v23; // bx@45 | |
231 // char v24; // al@46 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
232 signed int i; // edi@50 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
233 int v26; // edi@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
234 int v27; // eax@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
235 __int16 v28; // cx@55 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
236 int v29; // eax@55 |
2085 | 237 //signed int v30; // edi@59 |
238 BSPModel *bmodel; // ecx@61 | |
239 ODMFace *face; // edi@61 | |
2334 | 240 // int v33; // eax@62 |
241 // int v34; // ecx@62 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
242 int v35; // eax@63 |
1267 | 243 int v36; // ecx@67 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
244 __int16 v37; // ax@67 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
245 int v38; // eax@72 |
2085 | 246 //int v39; // eax@72 |
2334 | 247 // unsigned __int64 v40; // qax@72 |
248 // int v41; // eax@72 | |
249 // unsigned __int8 v42; // sf@74 | |
250 // unsigned __int8 v43; // of@74 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
251 int v44; // eax@77 |
2334 | 252 // __int16 v45; // bx@81 |
253 // int v46; // eax@85 | |
254 // const char *v47; // [sp-8h] [bp-B0h]@83 | |
255 // 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
|
256 int v49; // [sp+Ch] [bp-9Ch]@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
257 int v50; // [sp+10h] [bp-98h]@52 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
258 Vec3_int_ v51; // [sp+14h] [bp-94h]@11 |
619 | 259 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
|
260 int v54; // [sp+8Ch] [bp-1Ch]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
261 int v55; // [sp+90h] [bp-18h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
262 int v56; // [sp+94h] [bp-14h]@11 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
263 int v57; // [sp+98h] [bp-10h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
264 int v58; // [sp+9Ch] [bp-Ch]@1 |
1267 | 265 int on_water; // [sp+A0h] [bp-8h]@1 |
266 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
|
267 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
268 v58 = 0; |
2068 | 269 object = &pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID]; |
270 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
|
271 v55 = 0; |
2085 | 272 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
|
273 v7 = v6; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
274 v54 = v6; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
275 v8 = v6 + 1; |
2068 | 276 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
|
277 { |
1267 | 278 if ( on_water ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
279 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
280 v9 = v6 + 60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
281 if ( v55 ) |
2085 | 282 v9 = v6 + 30; |
2068 | 283 sub_42F960_create_object(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, v9); |
2085 | 284 SpriteObject::OnInteraction(uLayingItemID); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
285 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
286 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
287 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
288 v58 = 1; |
2068 | 289 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
|
290 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
291 if ( v58 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
292 { |
2068 | 293 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
|
294 goto LABEL_13; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
295 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
296 if ( v57 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
297 { |
2068 | 298 pSpriteObjects[uLayingItemID].vPosition.z = v8; |
2085 | 299 ODM_GetTerrainNormalAt(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, &v51); |
2068 | 300 pSpriteObjects[uLayingItemID].vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
301 v56 = abs(v51.y * pSpriteObjects[uLayingItemID].vVelocity.y + v51.z * pSpriteObjects[uLayingItemID].vVelocity.z + v51.x * pSpriteObjects[uLayingItemID].vVelocity.x) >> 16; | |
1546 | 302 //v60 = ((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16); |
2068 | 303 pSpriteObjects[uLayingItemID].vVelocity.x += fixpoint_mul(v56, v51.x); |
1546 | 304 //v60 = ((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16); |
2068 | 305 pSpriteObjects[uLayingItemID].vVelocity.y += fixpoint_mul(v56, v51.y); |
1546 | 306 //v60 = ((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16); |
2068 | 307 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
|
308 v7 = v54; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
309 goto LABEL_13; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
310 } |
2085 | 311 if ( object->uFlags & OBJECT_DESC_INTERACTABLE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
312 { |
2068 | 313 if ( pSpriteObjects[uLayingItemID].vPosition.z < v7 ) |
314 pSpriteObjects[uLayingItemID].vPosition.z = v8; | |
2085 | 315 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
|
316 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
317 } |
2068 | 318 pSpriteObjects[uLayingItemID].vPosition.z = v8; |
319 if ( !(object->uFlags & OBJECT_DESC_BOUNCE) || (v21 = -pSpriteObjects[uLayingItemID].vVelocity.z >> 1, pSpriteObjects[uLayingItemID].vVelocity.z = v21, (signed __int16)v21 < 10) ) | |
320 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1267 | 321 |
2068 | 322 pSpriteObjects[uLayingItemID].vVelocity.x = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.x); |
323 pSpriteObjects[uLayingItemID].vVelocity.y = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.y); | |
324 pSpriteObjects[uLayingItemID].vVelocity.z = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.z); | |
2085 | 325 if ( (pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y |
326 + 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
|
327 { |
2085 | 328 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
329 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
330 memset(&Dst, 0, 0x68u); | |
331 Dst.x = (double)pSpriteObjects[uLayingItemID].vPosition.x; | |
332 Dst.y = (double)pSpriteObjects[uLayingItemID].vPosition.y; | |
333 Dst.z = (double)pSpriteObjects[uLayingItemID].vPosition.z; | |
334 Dst.r = 0.0; | |
335 Dst.g = 0.0; | |
336 Dst.b = 0.0; | |
337 if (object->uFlags & OBJECT_DESC_TRIAL_FIRE ) | |
338 { | |
339 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; | |
340 Dst.uDiffuse = 0xFF3C1E; | |
341 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; | |
342 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
343 Dst.flt_28 = 1.0; | |
344 pGame->pParticleEngine->AddParticle(&Dst); | |
345 } | |
346 else if ( object->uFlags & OBJECT_DESC_TRIAL_LINE) | |
347 { | |
619 | 348 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
349 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
350 Dst.timeToLive = 64; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
351 Dst.uTextureID = 0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
352 Dst.flt_28 = 1.0; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
353 pGame->pParticleEngine->AddParticle(&Dst); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
354 } |
2085 | 355 else if ( object->uFlags & OBJECT_DESC_TRIAL_PARTICLE ) |
356 { | |
357 Dst.type = ParticleType_Bitmap | ParticleType_8; | |
358 Dst.uDiffuse = rand(); | |
359 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; | |
360 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
361 Dst.flt_28 = 1.0; | |
362 pGame->pParticleEngine->AddParticle(&Dst); | |
363 } | |
364 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
365 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
366 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
367 LABEL_13: |
2085 | 368 if ( pSpriteObjects[uLayingItemID].vPosition.x >= -0x8000 && pSpriteObjects[uLayingItemID].vPosition.x <= 0x8000 |
369 && pSpriteObjects[uLayingItemID].vPosition.y >= -0x8000 && pSpriteObjects[uLayingItemID].vPosition.y <= 0x8000 | |
370 && pSpriteObjects[uLayingItemID].vPosition.z > v7 && pSpriteObjects[uLayingItemID].vPosition.z <= 13000 | |
2068 | 371 || !(object->uFlags & OBJECT_DESC_INTERACTABLE) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
372 goto LABEL_92; |
2068 | 373 if ( pSpriteObjects[uLayingItemID].vPosition.z < v7 ) |
374 pSpriteObjects[uLayingItemID].vPosition.z = v8; | |
2085 | 375 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
|
376 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
377 LABEL_92: |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
378 stru_721530.field_0 = 0; |
2068 | 379 stru_721530.prolly_normal_d = object->uRadius; |
380 stru_721530.height = object->uHeight; | |
1546 | 381 stru_721530.field_8_radius = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
382 stru_721530.field_70 = 0; |
2085 | 383 for ( v55 = 0; v55 < 100; ++v55 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
384 { |
2068 | 385 stru_721530.position.x = pSpriteObjects[uLayingItemID].vPosition.x; |
1546 | 386 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
|
387 stru_721530.uSectorID = 0; |
2085 | 388 stru_721530.position.y = pSpriteObjects[uLayingItemID].vPosition.y; |
389 stru_721530.normal.y = pSpriteObjects[uLayingItemID].vPosition.y; | |
2068 | 390 stru_721530.position.z = pSpriteObjects[uLayingItemID].vPosition.z + stru_721530.prolly_normal_d + 1; |
1546 | 391 stru_721530.normal.z = stru_721530.position.z; |
2068 | 392 stru_721530.velocity.x = pSpriteObjects[uLayingItemID].vVelocity.x; |
393 stru_721530.velocity.y = pSpriteObjects[uLayingItemID].vVelocity.y; | |
394 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
|
395 if ( stru_721530._47050A(0) ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
396 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
397 _46E889_collide_against_bmodels(0); |
2085 | 398 _46E26D_collide_against_sprites(WorldPosToGridCellX(pSpriteObjects[uLayingItemID].vPosition.x), WorldPosToGridCellZ(pSpriteObjects[uLayingItemID].vPosition.y)); |
2068 | 399 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
|
400 _46EF01_collision_chech_player(0); |
2068 | 401 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
|
402 { |
2085 | 403 if (( PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid) >= 0 ) |
404 &&( 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
|
405 { |
2085 | 406 for (v56 =0; v56 < uNumActors; ++v56) |
407 { | |
408 if ( pActors[PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid)].GetActorsRelation(&pActors[v56]) ) | |
409 Actor::_46DF1A_collide_against_actor(v56, 0); | |
410 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
411 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
412 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
413 else |
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 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
|
416 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
|
417 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
418 v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; |
2068 | 419 v27 = ODM_GetFloorLevel( stru_721530.normal2.x, stru_721530.normal2.y, stru_721530.normal2.z - stru_721530.prolly_normal_d - 1, |
420 object->uHeight, &v49, &v50, 0); | |
1267 | 421 if ( on_water && v26 < v27 + 60 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
422 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
423 if ( v50 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
424 v44 = v27 + 30; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
425 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
426 v44 = v54 + 60; |
2068 | 427 sub_42F960_create_object(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, v44); |
2085 | 428 SpriteObject::OnInteraction(uLayingItemID); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
429 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
430 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
431 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
|
432 { |
2068 | 433 pSpriteObjects[uLayingItemID].vPosition.x = stru_721530.normal2.x; |
434 pSpriteObjects[uLayingItemID].vPosition.y = stru_721530.normal2.y; | |
435 pSpriteObjects[uLayingItemID].vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | |
436 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
|
437 memset(&Dst, 0, 0x68u); |
2068 | 438 Dst.x = (double)pSpriteObjects[uLayingItemID].vPosition.x; |
439 Dst.y = (double)pSpriteObjects[uLayingItemID].vPosition.y; | |
440 Dst.z = (double)pSpriteObjects[uLayingItemID].vPosition.z; | |
1390 | 441 Dst.r = 0.0; |
442 Dst.g = 0.0; | |
443 Dst.b = 0.0; | |
2068 | 444 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
|
445 { |
619 | 446 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
447 Dst.uDiffuse = 0xFF3C1E; | |
1267 | 448 Dst.timeToLive = (unsigned __int8)( rand() & 0x80) + 128; |
449 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
450 Dst.flt_28 = 1.0; | |
451 pGame->pParticleEngine->AddParticle(&Dst); | |
452 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
453 } |
2068 | 454 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
|
455 { |
619 | 456 Dst.type = ParticleType_Line; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
457 Dst.uTextureID = 0; |
1267 | 458 Dst.uDiffuse = rand(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
459 Dst.timeToLive = 64; |
1267 | 460 Dst.flt_28 = 1.0; |
461 pGame->pParticleEngine->AddParticle(&Dst); | |
462 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
463 } |
2068 | 464 else if ( object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) |
465 { | |
466 Dst.type = ParticleType_Bitmap | ParticleType_8; | |
467 Dst.uDiffuse = rand(); | |
468 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; | |
469 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
470 Dst.flt_28 = 1.0; | |
471 pGame->pParticleEngine->AddParticle(&Dst); | |
472 } | |
1267 | 473 return; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
474 } |
1546 | 475 //v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16); |
2068 | 476 pSpriteObjects[uLayingItemID].vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
1546 | 477 //v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16); |
2068 | 478 pSpriteObjects[uLayingItemID].vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
1546 | 479 //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
|
480 v28 = LOWORD(stru_721530.uSectorID); |
2068 | 481 pSpriteObjects[uLayingItemID].vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
482 v29 = pSpriteObjects[uLayingItemID].vPosition.z; | |
483 pSpriteObjects[uLayingItemID].uSectorID = v28; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
484 stru_721530.field_70 += stru_721530.field_7C; |
2068 | 485 if ( object->uFlags & OBJECT_DESC_INTERACTABLE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
486 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
487 if ( v29 < v54 ) |
2068 | 488 pSpriteObjects[uLayingItemID].vPosition.z = v54 + 1; |
2085 | 489 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
|
490 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
491 } |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
492 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
|
493 break; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
494 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
|
495 { |
2085 | 496 bmodel = &pOutdoor->pBModels[(signed int)stru_721530.uFaceID >> 9]; |
497 face = &bmodel->pFaces[PID_ID(stru_721530.uFaceID) & 0x3F]; | |
498 if ( face->uPolygonType != POLYGON_Floor ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
499 { |
2085 | 500 v56 = abs(face->pFacePlane.vNormal.x * pSpriteObjects[uLayingItemID].vVelocity.x |
501 + face->pFacePlane.vNormal.y * pSpriteObjects[uLayingItemID].vVelocity.y | |
502 + face->pFacePlane.vNormal.z * pSpriteObjects[uLayingItemID].vVelocity.z) >> 16; | |
1546 | 503 if ( (stru_721530.speed >> 3) > v56 ) |
504 v56 = stru_721530.speed >> 3; | |
2207 | 505 //v57 = fixpoint_mul(v56, face->pFacePlane.vNormal.x); |
506 //v58 = fixpoint_mul(v56, face->pFacePlane.vNormal.y); | |
507 v60 = fixpoint_mul(v56, face->pFacePlane.vNormal.z); | |
508 pSpriteObjects[uLayingItemID].vVelocity.x += 2 * fixpoint_mul(v56, face->pFacePlane.vNormal.x); | |
509 pSpriteObjects[uLayingItemID].vVelocity.y += 2 * fixpoint_mul(v56, face->pFacePlane.vNormal.y); | |
2085 | 510 if ( face->pFacePlane.vNormal.z <= 32000 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
511 v37 = 2 * (short)v60; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
512 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
513 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
514 v36 = v60; |
2068 | 515 pSpriteObjects[uLayingItemID].vVelocity.z += (signed __int16)v60; |
2207 | 516 v58 = fixpoint_mul(0x7D00, v36); |
517 v37 = fixpoint_mul(32000, v36); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
518 } |
2068 | 519 pSpriteObjects[uLayingItemID].vVelocity.z += v37; |
2085 | 520 if ( BYTE3(face->uAttributes) & 0x10 ) |
521 EventProcessor(face->sCogTriggeredID, 0, 1); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
522 goto LABEL_74; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
523 } |
2085 | 524 pSpriteObjects[uLayingItemID].vPosition.z = bmodel->pVertices.pVertices[face->pVertexIDs[0]].z + 1; |
525 if ( pSpriteObjects[uLayingItemID].vVelocity.x * pSpriteObjects[uLayingItemID].vVelocity.x | |
526 + pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y >= 400 ) | |
2068 | 527 { |
2207 | 528 if ( face->uAttributes & 0x10000000 ) |
2085 | 529 EventProcessor(face->sCogTriggeredID, 0, 1); |
2068 | 530 goto LABEL_74; |
531 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
532 LOWORD(v35) = 0; |
2068 | 533 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
534 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
535 pSpriteObjects[uLayingItemID].vVelocity.y = v35; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
536 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
537 LABEL_74: |
2085 | 538 pSpriteObjects[uLayingItemID].vVelocity.x = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.x); |
539 pSpriteObjects[uLayingItemID].vVelocity.y = fixpoint_mul(58500, pSpriteObjects[uLayingItemID].vVelocity.y); | |
540 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
|
541 } |
2085 | 542 v57 = integer_sqrt(pSpriteObjects[uLayingItemID].vVelocity.x * pSpriteObjects[uLayingItemID].vVelocity.x |
543 + pSpriteObjects[uLayingItemID].vVelocity.y * pSpriteObjects[uLayingItemID].vVelocity.y); | |
544 v38 = stru_5C6E00->Atan2(pSpriteObjects[uLayingItemID].vPosition.x - pLevelDecorations[PID_ID(stru_721530.uFaceID)].vPosition.x, | |
545 pSpriteObjects[uLayingItemID].vPosition.y - pLevelDecorations[PID_ID(stru_721530.uFaceID)].vPosition.y); | |
2207 | 546 pSpriteObjects[uLayingItemID].vVelocity.x = fixpoint_mul(stru_5C6E00->Cos(v38), v57); |
547 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
|
548 goto LABEL_74; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
549 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
550 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
551 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
552 //----- (0047136C) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
553 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
|
554 { |
717 | 555 SpriteObject *pSpriteObject; // esi@1 |
556 ObjectDesc *pObject; // edi@1 | |
2334 | 557 // int v9; // ecx@16 |
558 // __int16 v10; // di@18 | |
559 // int v14; // ebx@34 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
560 signed int v15; // ebx@46 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
561 int v17; // eax@50 |
2334 | 562 // int v18; // eax@52 |
563 // int v19; // ecx@52 | |
564 // Vec3_short_ *v20; // ecx@53 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
565 __int16 v22; // ax@57 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
566 int v23; // edi@62 |
2334 | 567 // unsigned __int8 v27; // sf@64 |
568 // unsigned __int8 v28; // of@64 | |
569 // __int16 v29; // di@67 | |
570 // char v30; // al@68 | |
619 | 571 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
|
572 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
|
573 int v39; // [sp+80h] [bp-10h]@33 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
574 int v40; // [sp+84h] [bp-Ch]@28 |
2085 | 575 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
|
576 |
717 | 577 pSpriteObject = &pSpriteObjects[uLayingItemID]; |
578 pObject = &pObjectList->pObjects[pSpriteObject->uObjectDescID]; | |
579 pSpriteObject->uSectorID = pIndoor->GetSector(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z); | |
723 | 580 v42 = BLV_GetFloorLevel(pSpriteObject->vPosition.x, pSpriteObject->vPosition.y, pSpriteObject->vPosition.z, pSpriteObject->uSectorID, &uFaceID); |
717 | 581 if ( abs(pSpriteObject->vPosition.x) > 32767 |
582 || abs(pSpriteObject->vPosition.y) > 32767 | |
583 || abs(pSpriteObject->vPosition.z) > 20000 | |
584 || v42 <= -30000 | |
585 && (pSpriteObject->uSectorID == 0)) | |
586 // || (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
|
587 { |
717 | 588 SpriteObject::OnInteraction(uLayingItemID); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
589 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
590 } |
2085 | 591 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
|
592 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
593 LABEL_25: |
2085 | 594 stru_721530.field_0 = 0; |
717 | 595 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
|
596 stru_721530.field_84 = -1; |
1546 | 597 stru_721530.height = pObject->uHeight; |
2085 | 598 stru_721530.field_8_radius = 0; |
599 stru_721530.field_70 = 0; | |
600 for ( uFaceID = 0; uFaceID < 100; uFaceID++ ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
601 { |
1546 | 602 stru_721530.position.x = pSpriteObject->vPosition.x; |
2085 | 603 stru_721530.position.y = pSpriteObject->vPosition.y; |
604 stru_721530.position.z = stru_721530.prolly_normal_d + pSpriteObject->vPosition.z + 1; | |
605 | |
1546 | 606 stru_721530.normal.x = stru_721530.position.x; |
607 stru_721530.normal.y = stru_721530.position.y; | |
608 stru_721530.normal.z = stru_721530.position.z; | |
2085 | 609 |
1546 | 610 stru_721530.velocity.x = pSpriteObject->vVelocity.x; |
611 stru_721530.velocity.y = pSpriteObject->vVelocity.y; | |
612 stru_721530.velocity.z = pSpriteObject->vVelocity.z; | |
2085 | 613 |
717 | 614 stru_721530.uSectorID = pSpriteObject->uSectorID; |
2085 | 615 if ( stru_721530._47050A(0) ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
616 return; |
2085 | 617 |
618 for ( v40 = 0; v40 < 100; ++v40 ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
619 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
620 _46E44E_collide_against_faces_and_portals(0); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
621 _46E0B2_collide_against_decorations(); |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
622 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
|
623 _46EF01_collision_chech_player(1); |
2085 | 624 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
|
625 { |
2085 | 626 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
|
627 { |
2085 | 628 if( pActors[pSpriteObject->spell_caster_pid >> 3].pMonsterInfo.uID != pActors[v42].pMonsterInfo.uID ) |
629 //not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius | |
630 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
|
631 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
632 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
633 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
634 { |
2085 | 635 for ( v42 = 0; v42 < (signed int)uNumActors; v42++ ) |
636 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
|
637 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
638 if ( _46F04E_collide_against_portals() ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
639 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
640 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
641 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
|
642 { |
717 | 643 pSpriteObject->vPosition.x = stru_721530.normal2.x; |
644 pSpriteObject->vPosition.y = stru_721530.normal2.y; | |
645 pSpriteObject->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; | |
646 pSpriteObject->uSectorID = LOWORD(stru_721530.uSectorID); | |
647 if ( !(HIBYTE(pObject->uFlags) & 1) ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
648 return; |
2085 | 649 memset(&Dst, 0, 0x68u); |
717 | 650 Dst.x = (double)pSpriteObject->vPosition.x; |
651 Dst.y = (double)pSpriteObject->vPosition.y; | |
652 Dst.z = (double)pSpriteObject->vPosition.z; | |
1390 | 653 Dst.r = 0.0; |
654 Dst.g = 0.0; | |
655 Dst.b = 0.0; | |
2085 | 656 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
|
657 { |
619 | 658 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
659 Dst.uDiffuse = 0xFF3C1E; | |
2085 | 660 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
661 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
662 Dst.flt_28 = 1.0; | |
663 pGame->pParticleEngine->AddParticle(&Dst); | |
664 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
665 } |
2085 | 666 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
|
667 { |
2085 | 668 Dst.type = ParticleType_Line; |
669 Dst.uDiffuse = rand(); | |
670 Dst.timeToLive = 64; | |
671 Dst.uTextureID = 0; | |
672 Dst.flt_28 = 1.0; | |
673 pGame->pParticleEngine->AddParticle(&Dst); | |
674 return; | |
675 } | |
676 else if ( pObject->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
677 { | |
619 | 678 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
679 Dst.uDiffuse = rand(); |
2085 | 680 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
681 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
682 Dst.flt_28 = 1.0; | |
683 pGame->pParticleEngine->AddParticle(&Dst); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
684 } |
717 | 685 return; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
686 } |
1546 | 687 //v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.x) >> 16; |
1643 | 688 pSpriteObject->vPosition.x += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.x); |
1546 | 689 //v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.y) >> 16; |
1643 | 690 pSpriteObject->vPosition.y += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.y); |
1546 | 691 //v40 = (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.direction.z) >> 16; |
1643 | 692 pSpriteObject->vPosition.z += fixpoint_mul(stru_721530.field_7C, stru_721530.direction.z); |
1574 | 693 pSpriteObject->uSectorID = stru_721530.uSectorID; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
694 stru_721530.field_70 += stru_721530.field_7C; |
2085 | 695 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
|
696 return; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
697 v15 = (signed int)stru_721530.uFaceID >> 3; |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
698 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
|
699 { |
717 | 700 v40 = integer_sqrt(pSpriteObject->vVelocity.x * pSpriteObject->vVelocity.x + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y); |
701 v23 = stru_5C6E00->Atan2(pSpriteObject->vPosition.x - pLevelDecorations[v15].vPosition.x, | |
702 pSpriteObject->vPosition.y - pLevelDecorations[v15].vPosition.y); | |
1643 | 703 pSpriteObject->vVelocity.x = fixpoint_mul(stru_5C6E00->Cos(v23), v40); |
704 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
|
705 } |
2085 | 706 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
|
707 { |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
822
diff
changeset
|
708 stru_721530.field_84 = (signed int)PID_ID(stru_721530.uFaceID); |
2085 | 709 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
|
710 { |
2085 | 711 v42 = abs(pIndoor->pFaces[v15].pFacePlane_old.vNormal.x * pSpriteObject->vVelocity.x |
712 + pIndoor->pFaces[v15].pFacePlane_old.vNormal.y * pSpriteObject->vVelocity.y | |
713 + pIndoor->pFaces[v15].pFacePlane_old.vNormal.z * pSpriteObject->vVelocity.z) >> 16; | |
1546 | 714 if ( (stru_721530.speed >> 3) > v42 ) |
715 v42 = stru_721530.speed >> 3; | |
2085 | 716 pSpriteObject->vVelocity.x += 2 * fixpoint_mul(v42, pIndoor->pFaces[v15].pFacePlane_old.vNormal.x); |
717 pSpriteObject->vVelocity.y += 2 * fixpoint_mul(v42, pIndoor->pFaces[v15].pFacePlane_old.vNormal.y); | |
718 v39 = fixpoint_mul(v42, pIndoor->pFaces[v15].pFacePlane_old.vNormal.z); | |
719 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
|
720 v22 = 2 * v39; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
721 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
722 { |
717 | 723 pSpriteObject->vVelocity.z += v39; |
1643 | 724 v22 = fixpoint_mul(32000, v39); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
725 } |
717 | 726 pSpriteObject->vVelocity.z += v22; |
2166 | 727 if ( pIndoor->pFaces[v15].uAttributes & FACE_UNKNOW2 ) |
2085 | 728 EventProcessor(pIndoor->pFaceExtras[pIndoor->pFaces[v15].uFaceExtraID].uEventID, 0, 1); |
729 pSpriteObject->vVelocity.x = fixpoint_mul(58500, pSpriteObject->vVelocity.x); | |
730 pSpriteObject->vVelocity.y = fixpoint_mul(58500, pSpriteObject->vVelocity.y); | |
731 pSpriteObject->vVelocity.z = fixpoint_mul(58500, pSpriteObject->vVelocity.z); | |
732 continue; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
733 } |
2085 | 734 if ( pObject->uFlags & OBJECT_DESC_BOUNCE ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
735 { |
2085 | 736 v17 = -pSpriteObject->vVelocity.z / 2; |
717 | 737 pSpriteObject->vVelocity.z = v17; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
738 if ( (signed __int16)v17 < 10 ) |
717 | 739 pSpriteObject->vVelocity.z = 0; |
2166 | 740 if ( pIndoor->pFaces[v15].uAttributes & FACE_UNKNOW2 ) |
2085 | 741 EventProcessor(pIndoor->pFaceExtras[pIndoor->pFaces[v15].uFaceExtraID].uEventID, 0, 1); |
742 pSpriteObject->vVelocity.x = fixpoint_mul(58500, pSpriteObject->vVelocity.x); | |
743 pSpriteObject->vVelocity.y = fixpoint_mul(58500, pSpriteObject->vVelocity.y); | |
744 pSpriteObject->vVelocity.z = fixpoint_mul(58500, pSpriteObject->vVelocity.z); | |
745 continue; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
746 } |
717 | 747 pSpriteObject->vVelocity.z = 0; |
2085 | 748 if ( pSpriteObject->vVelocity.x * pSpriteObject->vVelocity.x + pSpriteObject->vVelocity.y * pSpriteObject->vVelocity.y >= 400 ) |
717 | 749 { |
2166 | 750 if ( pIndoor->pFaces[v15].uAttributes & FACE_UNKNOW2 ) |
2085 | 751 EventProcessor(pIndoor->pFaceExtras[pIndoor->pFaces[v15].uFaceExtraID].uEventID, 0, 1); |
752 pSpriteObject->vVelocity.x = fixpoint_mul(58500, pSpriteObject->vVelocity.x); | |
753 pSpriteObject->vVelocity.y = fixpoint_mul(58500, pSpriteObject->vVelocity.y); | |
754 pSpriteObject->vVelocity.z = fixpoint_mul(58500, pSpriteObject->vVelocity.z); | |
755 continue; | |
717 | 756 } |
757 pSpriteObject->vVelocity.z = 0; | |
758 pSpriteObject->vVelocity.y = 0; | |
759 pSpriteObject->vVelocity.x = 0; | |
2085 | 760 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
|
761 } |
1643 | 762 pSpriteObject->vVelocity.x = fixpoint_mul(58500, pSpriteObject->vVelocity.x); |
763 pSpriteObject->vVelocity.y = fixpoint_mul(58500, pSpriteObject->vVelocity.y); | |
764 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
|
765 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
766 } |
2085 | 767 //äëÿ ïàäàþùèõ îáúåêòîâ(äëÿ ïðèìåðà âûáðîñ âåùè èç èíâåíòàðÿ) |
717 | 768 if ( v42 <= pSpriteObject->vPosition.z - 3 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
769 { |
717 | 770 pSpriteObject->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); |
2085 | 771 goto LABEL_25; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
772 } |
2085 | 773 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
|
774 { |
717 | 775 pSpriteObject->vPosition.z = v42 + 1; |
2085 | 776 if ( pIndoor->pFaces[uFaceID].uPolygonType == POLYGON_Floor ) |
717 | 777 pSpriteObject->vVelocity.z = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
778 else |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
779 { |
2085 | 780 if ( pIndoor->pFaces[uFaceID].pFacePlane_old.vNormal.z < 45000 ) |
717 | 781 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
|
782 } |
1643 | 783 pSpriteObject->vVelocity.x = fixpoint_mul(58500, pSpriteObject->vVelocity.x); |
784 pSpriteObject->vVelocity.y = fixpoint_mul(58500, pSpriteObject->vVelocity.y); | |
785 pSpriteObject->vVelocity.z = fixpoint_mul(58500, pSpriteObject->vVelocity.z); | |
2085 | 786 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
|
787 { |
2085 | 788 pSpriteObject->vVelocity.x = 0; |
789 pSpriteObject->vVelocity.y = 0; | |
790 pSpriteObject->vVelocity.z = 0; | |
791 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
|
792 return; |
2085 | 793 memset(&Dst, 0, 0x68u); |
717 | 794 Dst.x = (double)pSpriteObject->vPosition.x; |
795 Dst.y = (double)pSpriteObject->vPosition.y; | |
796 Dst.z = (double)pSpriteObject->vPosition.z; | |
1390 | 797 Dst.r = 0.0; |
798 Dst.g = 0.0; | |
799 Dst.b = 0.0; | |
2085 | 800 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
|
801 { |
619 | 802 Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; |
803 Dst.uDiffuse = 0xFF3C1E; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
804 Dst.flt_28 = 1.0; |
2085 | 805 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
806 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); | |
807 pGame->pParticleEngine->AddParticle(&Dst); | |
808 return; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
809 } |
2085 | 810 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
|
811 { |
2085 | 812 Dst.type = ParticleType_Line; |
813 Dst.uDiffuse = rand(); | |
814 Dst.timeToLive = 64; | |
815 Dst.uTextureID = 0; | |
816 Dst.flt_28 = 1.0; | |
817 pGame->pParticleEngine->AddParticle(&Dst); | |
818 return; | |
819 } | |
820 else if ( pObject->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
821 { | |
619 | 822 Dst.type = ParticleType_Bitmap | ParticleType_8; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
823 Dst.uDiffuse = rand(); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
824 Dst.flt_28 = 1.0; |
2085 | 825 Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; |
826 Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); | |
827 pGame->pParticleEngine->AddParticle(&Dst); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
828 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
829 return; |
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 goto LABEL_25; |
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 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
834 // 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
|
835 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
836 //----- (00438E35) -------------------------------------------------------- |
1406 | 837 void SpriteObject::ExplosionTraps() |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
838 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
839 MapInfo *pMapInfo; // esi@1 |
1406 | 840 int dir_x; // ebx@1 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
841 int v7; // edx@2 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
842 unsigned int v10; // eax@7 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
843 signed int v11; // ebx@8 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
844 signed int v13; // edi@20 |
1406 | 845 int dir_y; // [sp+Ch] [bp-Ch]@1 |
846 int dir_z; // [sp+10h] [bp-8h]@1 | |
847 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
|
848 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1450
diff
changeset
|
849 pMapInfo = &pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]; |
1406 | 850 dir_x = abs(pParty->vPosition.x - this->vPosition.x); |
851 dir_y = abs(pParty->vPosition.y - this->vPosition.y); | |
852 dir_z = abs(pParty->vPosition.z + pParty->sEyelevel - this->vPosition.z); | |
853 if ( dir_x < dir_y ) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
854 { |
1406 | 855 v7 = dir_x; |
856 dir_x = dir_y; | |
857 dir_y = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
858 } |
1406 | 859 if ( dir_x < dir_z ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
860 { |
1406 | 861 v7 = dir_x; |
862 dir_x = dir_z; | |
863 dir_z = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
864 } |
1406 | 865 if ( dir_y < dir_z ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
866 { |
1406 | 867 v7 = dir_z; |
868 dir_z = dir_y; | |
869 dir_y = v7; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
870 } |
1406 | 871 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
|
872 if ( (signed int)v10 <= 768 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
873 { |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
874 v11 = 5; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
875 if ( pMapInfo->Trap_D20 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
876 { |
1406 | 877 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
|
878 v11 += rand() % 20 + 1; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
879 } |
1406 | 880 switch ( this->uType ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
881 { |
1406 | 882 case 811: |
883 pDamageType = DMGT_FIRE; | |
884 break; | |
885 case 812: | |
886 pDamageType = DMGT_ELECTR; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
887 break; |
1406 | 888 case 813: |
889 pDamageType = DMGT_COLD; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
890 break; |
1406 | 891 case 814: |
892 pDamageType = DMGT_BODY; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
893 break; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
894 default: |
1406 | 895 return; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
896 } |
1406 | 897 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
|
898 { |
1406 | 899 if ( pPlayers[i]->CanAct() && (v13 = pPlayers[i]->GetPerception() + 20, rand() % v13 > 20) ) |
900 pPlayers[i]->PlaySound(SPEECH_6, 0); | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
901 else |
1406 | 902 pPlayers[i]->ReceiveDamage(v11, pDamageType); |
515
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 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
905 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
906 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
907 //----- (0042F933) -------------------------------------------------------- |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
908 void SpriteObject::OnInteraction(unsigned int uLayingItemID) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
909 { |
837 | 910 pSpriteObjects[uLayingItemID].uObjectDescID = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
911 if ( pParty->bTurnBasedModeOn == 1 ) |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
912 { |
837 | 913 if (pSpriteObjects[uLayingItemID].uAttributes & 4 ) |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
914 { |
1062 | 915 pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; |
1450 | 916 --pTurnEngine->pending_actions; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
917 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
918 } |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
diff
changeset
|
919 } |
810 | 920 |
921 | |
922 //----- (0042FA22) -------------------------------------------------------- | |
923 void CompactLayingItemsList() | |
2085 | 924 { |
925 int new_obj_pos = 0; | |
810 | 926 |
2124 | 927 for ( int i = 0; i < MAX_SPRITE_OBJECTS; ++i ) |
2085 | 928 { |
2124 | 929 if ( pSpriteObjects[i].uObjectDescID ) |
930 { | |
931 if ( i != new_obj_pos )// | |
932 { | |
933 memcpy(&pSpriteObjects[new_obj_pos], &pSpriteObjects[i],sizeof(SpriteObject)); | |
934 pSpriteObjects[i].uObjectDescID = 0; | |
935 } | |
936 new_obj_pos++; | |
937 } | |
2085 | 938 } |
939 uNumSpriteObjects = new_obj_pos; | |
940 } | |
1297 | 941 //----- (00408896) -------------------------------------------------------- |
2338
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2336
diff
changeset
|
942 void SpriteObject::InitializeSpriteObjects() |
1297 | 943 { |
944 for (uint i = 0; i < uNumSpriteObjects; ++i) | |
945 { | |
1980 | 946 SpriteObject* item = &pSpriteObjects[i]; |
1297 | 947 |
2085 | 948 if (item->uType && (item->uSoundID & 8 || pObjectList->pObjects[item->uType].uFlags & OBJECT_DESC_UNPICKABLE)) |
1297 | 949 SpriteObject::OnInteraction(i); |
950 } | |
951 } | |
952 //----- (0046BEF1) -------------------------------------------------------- | |
953 void SpriteObject::_46BEF1_apply_spells_aoe() | |
954 { | |
2085 | 955 //SpriteObject *v1; // edi@1 |
956 //Actor *v2; // esi@2 | |
957 //__int16 v3; // fps@4 | |
958 //unsigned __int8 v4; // c0@4 | |
959 //unsigned __int8 v5; // c3@4 | |
960 //signed int v6; // [sp+8h] [bp-4h]@1 | |
1297 | 961 |
2085 | 962 int v7,v9,v10,v11; |
963 __debugbreak();//Ritor1 | |
1297 | 964 if ( (signed int)uNumActors > 0 ) |
965 { | |
2085 | 966 for ( uint i = 0; i < uNumActors; ++i ) |
1297 | 967 { |
2085 | 968 if ( pActors[i].CanAct() ) |
1297 | 969 { |
970 //UNDEF(v3); | |
971 //.text:0046BF26 movsx eax, word ptr [esi-2] | |
972 //.text:0046BF2A sub eax, [edi+4] | |
973 //.text:0046BF31 mov [ebp+var_8], eax | |
974 //.text:0046BF37 fild [ebp+var_8] | |
975 // v7 pushed to stack | |
2085 | 976 v7 = pActors[i].vPosition.x - this->vPosition.x; |
1297 | 977 |
978 //.text:0046BF2D movsx ecx, word ptr [esi+2] | |
2085 | 979 //v8 = pActors[i].vPosition.z; |
1297 | 980 |
981 //.text:0046BF34 movsx eax, word ptr [esi] | |
982 //.text:0046BF3A sub eax, [edi+8] | |
983 //.text:0046BF3D mov [ebp+var_8], eax | |
984 //.text:0046BF44 fild [ebp+var_8] | |
985 // v9 pushed to stack | |
2085 | 986 v9 = pActors[i].vPosition.y - this->vPosition.y; |
1297 | 987 |
988 //.text:0046BF40 movsx eax, word ptr [esi-6] | |
989 //.text:0046BF47 sar eax, 1 | |
990 //.text:0046BF49 add eax, ecx | |
991 //.text:0046BF4B sub eax, [edi+0Ch] | |
992 //.text:0046BF4E mov [ebp+var_8], eax | |
993 //.text:0046BF51 fild [ebp+var_8] | |
994 //.text:0046BF58 fld st | |
995 // v10 pushed to stack, two times | |
2085 | 996 v10 = pActors[i].uActorHeight / 2 + pActors[i].vPosition.z - this->vVelocity.y; |
1297 | 997 |
998 //.text:0046BF54 movsx eax, word ptr [esi-8] | |
999 //.text:0046BF5A add eax, 100h | |
1000 //.text:0046BF63 mov ecx, eax | |
2085 | 1001 //v11 = this->vVelocity.x; |
1297 | 1002 |
1003 //.text:0046BF5F fmul st, st(1) | |
1004 // stack: v10*v10, v10, v9, v7 | |
1005 //.text:0046BF61 fld st(2) | |
1006 // stack: v7, v10*v10, v10, v9, v7 | |
1007 | |
1008 | |
1009 //.text:0046BF65 fmul st, st(3) | |
1010 // stack: v7*v9, v10*v10, v10, v9, v7 | |
1011 | |
1012 //.text:0046BF67 imul ecx, eax | |
2085 | 1013 v11 = this->vVelocity.x * this->vVelocity.x; |
1297 | 1014 |
1015 //.text:0046BF6A faddp st(1), st | |
1016 // stack: v10*v10+v7*v9, v10, v9, v7 | |
1017 //.text:0046BF6C fld st(3) | |
1018 // stack: v7, v10*v10+v7*v9, v10, v9, v7 | |
1019 //.text:0046BF6E fmul st, st(4) | |
1020 // stack: v7*v7, v10*v10+v7*v9, v10, v9, v7 | |
1021 //.text:0046BF70 faddp st(1), st | |
1022 // stack: v10*v10+v7*v9+v7*v7, v10, v9, v7 | |
1023 | |
1024 //.text:0046BF72 mov [ebp+var_8], ecx | |
1025 //.text:0046BF75 fild [ebp+var_8] | |
1026 // v11 pushed to stack | |
1027 | |
1028 //.text:0046BF78 fcompp | |
1029 // if ( v11 > v10*v10+v7*v9+v7*v7 ) | |
1030 // stack: v10, v9, v7 | |
1031 | |
1032 //.text:0046BF7A fstp st | |
1033 // stack: v9, v7 | |
1034 | |
1035 //.text:0046BF7C fnstsw ax | |
1036 //.text:0046BF7E fstp st | |
1037 // stack: v7 | |
1038 | |
1039 //.text:0046BF80 test ah, 41h | |
1040 //.text:0046BF83 fstp st | |
1041 //.text:0046BF85 jnz short loc_46BFDD | |
1042 | |
2085 | 1043 if ( v11 >= v7 * v7 + v9 * v9 + v10 * v10 ) |
1297 | 1044 { |
2301 | 1045 if ( pActors[i].DoesDmgTypeDoDamage((DAMAGE_TYPE)0xAu) ) |
1297 | 1046 { |
2085 | 1047 pActors[i].pActorBuffs[this->spell_id].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(this->spell_level << 7) * 0.033333335), |
1048 this->spell_skill, 4, 0, 0); | |
1049 HIWORD(pActors[i].uAttributes) |= 8; | |
1297 | 1050 } |
1051 } | |
1052 } | |
1053 } | |
1054 } | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1055 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1056 |
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 //----- (0042F7EB) -------------------------------------------------------- |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1059 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
|
1060 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1061 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
|
1062 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
|
1063 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1064 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
|
1065 if ( a9 ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1066 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
|
1067 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
|
1068 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
|
1069 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
|
1070 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
|
1071 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
|
1072 pObjectDescID = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1073 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
|
1074 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1075 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
|
1076 pObjectDescID = i; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1077 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1078 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
|
1079 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
|
1080 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
|
1081 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
|
1082 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
|
1083 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
|
1084 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
|
1085 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
|
1086 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
|
1087 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
|
1088 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
|
1089 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1090 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
|
1091 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1092 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
|
1093 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1094 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
|
1095 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
|
1096 } |
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 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1099 if ( a7 ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1100 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1101 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
|
1102 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1103 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
|
1104 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1105 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
|
1106 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
|
1107 ((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
|
1108 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1109 } |
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 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1112 else |
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 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
|
1115 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
|
1116 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1117 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
|
1118 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1119 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
|
1120 } |
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 return true; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1124 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1125 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1126 //----- (0042F960) -------------------------------------------------------- |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1127 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
|
1128 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1129 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
|
1130 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
|
1131 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
|
1132 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1133 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
|
1134 //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
|
1135 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
|
1136 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1137 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
|
1138 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
|
1139 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
|
1140 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
|
1141 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
|
1142 v7 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1143 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
|
1144 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1145 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
|
1146 v7 = i; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1147 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1148 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
|
1149 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
|
1150 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
|
1151 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
|
1152 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
|
1153 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
|
1154 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
|
1155 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
|
1156 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
|
1157 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
|
1158 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
|
1159 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
|
1160 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2301
diff
changeset
|
1161 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
|
1162 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
|
1163 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
|
1164 } |
2463 | 1165 } |
1166 | |
1167 //----- (0046BFFA) -------------------------------------------------------- | |
1168 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2) | |
1169 { | |
1170 ObjectDesc *object; // ebx@1 | |
1171 unsigned int v8; // eax@19 | |
1172 signed int v10; // ebx@19 | |
1173 char *v11; // edx@20 | |
1174 unsigned __int16 v12; // ax@23 | |
1175 int v13; // eax@27 | |
1176 int v16; // eax@36 | |
1177 __int16 v18; // di@37 | |
1178 signed int v19; // edx@37 | |
1179 unsigned __int16 v22; // ax@41 | |
1180 signed int v24; // ebx@46 | |
1181 char *v25; // edx@47 | |
1182 signed int v34; // edx@65 | |
1183 unsigned __int16 v36; // ax@69 | |
1184 int v37; // ST14_4@72 | |
1185 int v38; // eax@72 | |
1186 int v39; // ST10_4@72 | |
1187 int v40; // ST0C_4@72 | |
1188 unsigned __int8 v44; // zf@79 | |
1189 int v47; // eax@81 | |
1190 signed int v52; // ebx@93 | |
1191 signed int v56; // ebx@98 | |
1192 unsigned __int16 v58; // ax@102 | |
1193 unsigned __int16 v59; // ax@107 | |
1194 signed int v61; // ebx@107 | |
1195 unsigned __int16 v63; // ax@111 | |
1196 int v64; // ebx@114 | |
1197 signed int v65; // eax@114 | |
1198 signed int v69; // ebx@124 | |
1199 unsigned __int16 v71; // ax@128 | |
1200 unsigned int v72; // ebx@131 | |
1201 int v78; // eax@133 | |
1202 signed int v81; // edx@140 | |
1203 unsigned __int16 v83; // ax@144 | |
1204 signed int v86; // ebx@151 | |
1205 unsigned __int16 v88; // ax@155 | |
1206 unsigned int v89; // eax@158 | |
1207 int v90; // ST34_4@159 | |
1208 int v91; // eax@159 | |
1209 unsigned int v92; // eax@163 | |
1210 unsigned __int16 v95; // ax@181 | |
1211 unsigned __int16 v96; // ax@184 | |
1212 int v97; // eax@185 | |
1213 char v100; // ST18_1@198 | |
1214 int v102; // eax@198 | |
1215 signed int v106; // eax@208 | |
1216 unsigned int v107; // edx@220 | |
1217 signed int v108; // ebx@225 | |
1218 signed int v110; // ebx@234 | |
1219 unsigned __int16 v112; // ax@238 | |
1220 unsigned __int16 v113; // si@241 | |
1221 int v114; // eax@242 | |
1222 int v115; // eax@245 | |
1223 signed int v119; // ebx@251 | |
1224 unsigned __int16 v121; // ax@255 | |
1225 int v124; // eax@267 | |
1226 int v125; // [sp-20h] [bp-4Ch]@28 | |
1227 char v132; // [sp-8h] [bp-34h]@131 | |
1228 char v134; // [sp-4h] [bp-30h]@131 | |
1229 signed int v135; // [sp-4h] [bp-30h]@217 | |
1230 int v136; // [sp+Ch] [bp-20h]@208 | |
1231 int v137; // [sp+10h] [bp-1Ch]@208 | |
1232 signed int v138; // [sp+14h] [bp-18h]@207 | |
1233 signed int v139; // [sp+18h] [bp-14h]@208 | |
1234 signed int v141; // [sp+1Ch] [bp-10h]@117 | |
1235 unsigned int v142; // [sp+1Ch] [bp-10h]@158 | |
1236 signed int v143; // [sp+1Ch] [bp-10h]@172 | |
1237 signed int v146; // [sp+20h] [bp-Ch]@60 | |
1238 int v147; // [sp+20h] [bp-Ch]@72 | |
1239 signed int v148; // [sp+20h] [bp-Ch]@158 | |
1240 unsigned __int16 v150; // [sp+20h] [bp-Ch]@208 | |
1241 signed int v152; // [sp+24h] [bp-8h]@208 | |
1242 | |
1243 object = &pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID]; | |
1244 //v151 = PID_TYPE(a2); | |
1245 if (PID_TYPE(a2) == OBJECT_Actor) | |
1246 { | |
1247 if (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Actor | |
1248 && !pActors[PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid)].GetActorsRelation(&pActors[PID_ID(a2)])) | |
1249 return 1; | |
1250 } | |
1251 else | |
1252 { | |
1253 if (PID_TYPE(a2) == OBJECT_Player && PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Player) | |
1254 return 1; | |
1255 } | |
1256 if (pParty->bTurnBasedModeOn == 1) | |
1257 { | |
1258 if (pSpriteObjects[uLayingItemID].uAttributes & 4) | |
1259 { | |
1260 --pTurnEngine->pending_actions; | |
1261 pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; | |
1262 } | |
1263 } | |
1264 if (PID_TYPE(a2) == OBJECT_BModel && PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) != OBJECT_Player) | |
1265 { | |
1266 if (PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid) < 500) //bugfix PID_ID(v2->spell_caster_pid)==1000 | |
1267 pActors[PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid)].uAttributes |= 0x40000; | |
1268 } | |
1269 | |
1270 //v6 = v2->uType; | |
1271 //v7 = v2->uType; | |
1272 | |
1273 switch (pSpriteObjects[uLayingItemID].uType) | |
1274 { | |
1275 | |
1276 case 1060: | |
1277 case 2030: | |
1278 case 9010: | |
1279 { | |
1280 //v9 = 0; | |
1281 if (PID_TYPE(a2) == 6 || PID_TYPE(a2) == 5 || !PID_TYPE(a2)) | |
1282 return 1; | |
1283 if (PID_TYPE(a2) != 2) | |
1284 { | |
1285 sub_43A97E(uLayingItemID, a2); | |
1286 ++pSpriteObjects[uLayingItemID].uType; | |
1287 v95 = 0; | |
1288 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
1289 { | |
1290 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
1291 v95 = v52; | |
1292 } | |
1293 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
1294 if (!v95) | |
1295 SpriteObject::OnInteraction(uLayingItemID); | |
1296 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1297 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1298 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1299 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1300 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
1301 v97 = 0; | |
1302 else | |
1303 v97 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1304 v124 = 8 * uLayingItemID; | |
1305 LOBYTE(v124) = v124 | 2; | |
1306 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1307 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
1308 return 0; | |
1309 } | |
1310 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
1311 v121 = 0; | |
1312 for (v119 = 0; v119 < (signed int)pObjectList->uNumObjects; ++v119) | |
1313 { | |
1314 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v119].uObjectID) | |
1315 v121 = v119; | |
1316 } | |
1317 pSpriteObjects[uLayingItemID].uObjectDescID = v121; | |
1318 if (!v121) | |
1319 SpriteObject::OnInteraction(uLayingItemID); | |
1320 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1321 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1322 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1323 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1324 v13 = 8 * uLayingItemID; | |
1325 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
1326 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
1327 return 0; | |
1328 } | |
1329 | |
1330 | |
1331 case 500: | |
1332 case 505: | |
1333 case 510: | |
1334 case 515: | |
1335 case 520: | |
1336 case 525: | |
1337 case 530: | |
1338 case 535: | |
1339 case 540: | |
1340 { | |
1341 sub_43A97E(uLayingItemID, a2); | |
1342 ++pSpriteObjects[uLayingItemID].uType; | |
1343 v12 = 0; | |
1344 for (v10 = 0; v10 < (signed int)pObjectList->uNumObjects; ++v10) | |
1345 { | |
1346 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v10].uObjectID) | |
1347 v12 = v10; | |
1348 } | |
1349 pSpriteObjects[uLayingItemID].uObjectDescID = v12; | |
1350 if (!v12) | |
1351 SpriteObject::OnInteraction(uLayingItemID); | |
1352 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1353 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1354 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1355 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1356 if (pSpriteObjects[uLayingItemID].uType == 555) | |
1357 { | |
1358 v13 = 8 * uLayingItemID; | |
1359 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
1360 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
1361 } | |
1362 return 0; | |
1363 } | |
1364 | |
1365 case 545: | |
1366 case 550: | |
1367 { | |
1368 if (pSpriteObjects[uLayingItemID].stru_24.uItemID != 405 && pSpriteObjects[uLayingItemID].stru_24.uSpecEnchantmentType != 3) | |
1369 { | |
1370 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1371 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1372 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1373 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1374 sub_43A97E(uLayingItemID, a2); | |
1375 SpriteObject::OnInteraction(uLayingItemID); | |
1376 if (pSpriteObjects[uLayingItemID].uSoundID == 0) | |
1377 v16 = 0; | |
1378 else | |
1379 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1380 v124 = 8 * uLayingItemID; | |
1381 LOBYTE(v124) = v124 | 2; | |
1382 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id] + 1; | |
1383 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
1384 return 0; | |
1385 } | |
1386 v18 = 0; | |
1387 pSpriteObjects[uLayingItemID].uType = 600; | |
1388 v22 = 0; | |
1389 for (v19 = 0; v19 < (signed int)pObjectList->uNumObjects; ++v19) | |
1390 { | |
1391 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v19].uObjectID) | |
1392 v22 = v19; | |
1393 } | |
1394 pSpriteObjects[uLayingItemID].uObjectDescID = v22; | |
1395 if (!v22) | |
1396 SpriteObject::OnInteraction(uLayingItemID); | |
1397 pSpriteObjects[uLayingItemID].vVelocity.z = v18; | |
1398 pSpriteObjects[uLayingItemID].vVelocity.y = v18; | |
1399 pSpriteObjects[uLayingItemID].vVelocity.x = v18; | |
1400 pSpriteObjects[uLayingItemID].uSpriteFrameID = v18; | |
1401 v12 = 0; | |
1402 for (v10; v10 < (signed int)v8; ++v10) | |
1403 { | |
1404 v11 += 56; | |
1405 if (pSpriteObjects[uLayingItemID].uType != *(short *)v11) | |
1406 v12 = v10; | |
1407 } | |
1408 pSpriteObjects[uLayingItemID].uObjectDescID = v12; | |
1409 if (!v12) | |
1410 SpriteObject::OnInteraction(uLayingItemID); | |
1411 v44 = pSpriteObjects[uLayingItemID].uType == 555; | |
1412 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1413 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1414 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1415 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1416 if (!v44) | |
1417 { | |
1418 v13 = 8 * uLayingItemID; | |
1419 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
1420 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
1421 return 0; | |
1422 } | |
1423 return 0; | |
1424 } | |
1425 | |
1426 case 600: | |
1427 { | |
1428 pSpriteObjects[uLayingItemID].uType = 601; | |
1429 v36 = 0; | |
1430 for (v34 = 0; v34 < (signed int)pObjectList->uNumObjects; ++v34) | |
1431 { | |
1432 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v34].uObjectID) | |
1433 v36 = v34; | |
1434 } | |
1435 pSpriteObjects[uLayingItemID].uObjectDescID = v36; | |
1436 if (!v36) | |
1437 SpriteObject::OnInteraction(uLayingItemID); | |
1438 v37 = pSpriteObjects[uLayingItemID].vPosition.z; | |
1439 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1440 v38 = 8 * uLayingItemID; | |
1441 v39 = pSpriteObjects[uLayingItemID].vPosition.y; | |
1442 LOBYTE(v38) = PID(OBJECT_Item, uLayingItemID); | |
1443 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1444 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1445 v40 = pSpriteObjects[uLayingItemID].vPosition.x; | |
1446 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1447 v147 = v38; | |
1448 AttackerInfo.Add(v38, 512, v40, v39, v37, 0, 0); | |
1449 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
1450 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
1451 pAudioPlayer->PlaySound(SOUND_8, v147, 0, -1, 0, 0, 0, 0); | |
1452 return 0; | |
1453 } | |
1454 | |
1455 case 1010: | |
1456 case 1100: | |
1457 case 2060: | |
1458 case 3010: | |
1459 case 3030: | |
1460 case 3060: | |
1461 case 4000: | |
1462 case 4030: | |
1463 case 4050: | |
1464 case 4100: | |
1465 case 6010: | |
1466 case 6090: | |
1467 { | |
1468 sub_43A97E(uLayingItemID, a2); | |
1469 ++pSpriteObjects[uLayingItemID].uType; | |
1470 v95 = 0; | |
1471 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
1472 { | |
1473 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
1474 v95 = v52; | |
1475 } | |
1476 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
1477 if (!v95) | |
1478 SpriteObject::OnInteraction(uLayingItemID); | |
1479 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
1480 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1481 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1482 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1483 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1484 if (!v96) | |
1485 v97 = 0; | |
1486 else | |
1487 v97 = (signed __int16)v96 + 4; | |
1488 v124 = 8 * uLayingItemID; | |
1489 LOBYTE(v124) = v124 | 2; | |
1490 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1491 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
1492 return 0; | |
1493 } | |
1494 | |
1495 | |
1496 case 555: | |
1497 { | |
1498 sub_43A97E(uLayingItemID, a2); | |
1499 ++pSpriteObjects[uLayingItemID].uType; | |
1500 v18 = 0; | |
1501 v22 = 0; | |
1502 v25 = (char *)&pObjectList->pObjects->uObjectID; | |
1503 for (v24 = 0; v24 < (signed int)pObjectList->uNumObjects; ++v24) | |
1504 { | |
1505 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v24].uObjectID) | |
1506 v22 = v24; | |
1507 } | |
1508 pSpriteObjects[uLayingItemID].uObjectDescID = v22; | |
1509 if (v22 == v18) | |
1510 SpriteObject::OnInteraction(uLayingItemID); | |
1511 pSpriteObjects[uLayingItemID].vVelocity.z = v18; | |
1512 pSpriteObjects[uLayingItemID].vVelocity.y = v18; | |
1513 pSpriteObjects[uLayingItemID].vVelocity.x = v18; | |
1514 pSpriteObjects[uLayingItemID].uSpriteFrameID = v18; | |
1515 return 0; | |
1516 } | |
1517 | |
1518 case 3090: | |
1519 { | |
1520 //v9 = 0; | |
1521 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 2; | |
1522 v63 = 0; | |
1523 for (v61 = 0; v61 < (signed int)pObjectList->uNumObjects; ++v61) | |
1524 { | |
1525 if (v59 == pObjectList->pObjects[v61].uObjectID) | |
1526 v63 = v61; | |
1527 } | |
1528 pSpriteObjects[uLayingItemID].uObjectDescID = v63; | |
1529 if (!v63) | |
1530 SpriteObject::OnInteraction(uLayingItemID); | |
1531 v64 = pSpriteObjects[uLayingItemID].uFacing - stru_5C6E00->uIntegerDoublePi; | |
1532 v44 = pSpriteObjects[uLayingItemID].spell_skill == 4; | |
1533 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1534 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1535 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1536 v65 = 7; | |
1537 if (v44) | |
1538 v65 = 9; | |
1539 if (v65 > 0) | |
1540 { | |
1541 v141 = v65; | |
1542 do | |
1543 { | |
1544 v64 += (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
1545 pSpriteObjects[uLayingItemID].Create(v64, 0, 1000, 0); | |
1546 --v141; | |
1547 } while (v141); | |
1548 } | |
1549 SpriteObject::OnInteraction(uLayingItemID); | |
1550 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
1551 v16 = 0; | |
1552 else | |
1553 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1554 v124 = 8 * uLayingItemID; | |
1555 LOBYTE(v124) = v124 | 2; | |
1556 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1557 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
1558 return 0; | |
1559 } | |
1560 | |
1561 case 3092: | |
1562 { | |
1563 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType - 1; | |
1564 v58 = 0; | |
1565 for (v56 = 0; v56 < (signed int)pObjectList->uNumObjects; ++v56) | |
1566 { | |
1567 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v56].uObjectID) | |
1568 v58 = v56; | |
1569 } | |
1570 pSpriteObjects[uLayingItemID].uObjectDescID = v58; | |
1571 if (!v58) | |
1572 SpriteObject::OnInteraction(uLayingItemID); | |
1573 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1574 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1575 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1576 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1577 sub_43A97E(uLayingItemID, a2); | |
1578 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
1579 v16 = 0; | |
1580 else | |
1581 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1582 v124 = 8 * uLayingItemID; | |
1583 LOBYTE(v124) = v124 | 2; | |
1584 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1585 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
1586 return 0; | |
1587 } | |
1588 | |
1589 case 4070: | |
1590 { | |
1591 if (PID_TYPE(a2) == 6 || PID_TYPE(a2) == 5 || !PID_TYPE(a2)) | |
1592 return 1; | |
1593 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
1594 v71 = 0; | |
1595 for (v69 = 0; v69 < (signed int)pObjectList->uNumObjects; ++v69) | |
1596 { | |
1597 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v69].uObjectID) | |
1598 v71 = v69; | |
1599 } | |
1600 pSpriteObjects[uLayingItemID].uObjectDescID = v71; | |
1601 if (!v71) | |
1602 SpriteObject::OnInteraction(uLayingItemID); | |
1603 v134 = 0; | |
1604 v72 = uLayingItemID; | |
1605 v132 = 0; | |
1606 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1607 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1608 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1609 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1610 AttackerInfo.Add(PID(OBJECT_Item, v72), 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v132, v134); | |
1611 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
1612 v78 = 0; | |
1613 else | |
1614 v78 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1615 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1616 pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, 0, -1, 0, v78, 0, 0); | |
1617 return 0; | |
1618 } | |
1619 | |
1620 case 4090: | |
1621 { | |
1622 //v9 = 0; | |
1623 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 2; | |
1624 v88 = 0; | |
1625 for (v86 = 0; v86 < (signed int)pObjectList->uNumObjects; ++v86) | |
1626 { | |
1627 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v86].uObjectID) | |
1628 v88 = v86; | |
1629 } | |
1630 pSpriteObjects[uLayingItemID].uObjectDescID = v88; | |
1631 if (!v88) | |
1632 SpriteObject::OnInteraction(uLayingItemID); | |
1633 v89 = pSpriteObjects[uLayingItemID].uFacing - stru_5C6E00->uIntegerDoublePi; | |
1634 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1635 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1636 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1637 v142 = v89; | |
1638 v148 = 7; | |
1639 do | |
1640 { | |
1641 pRnd->SetRange(-128, 128); | |
1642 v90 = pRnd->GetInRange(); | |
1643 pRnd->SetRange(5, 500); | |
1644 v91 = pRnd->GetInRange(); | |
1645 v142 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1; | |
1646 pSpriteObjects[uLayingItemID].Create(v90 + v142, 0, v91, 0); | |
1647 --v148; | |
1648 } while (v148); | |
1649 SpriteObject::OnInteraction(uLayingItemID); | |
1650 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
1651 v16 = 0; | |
1652 else | |
1653 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1654 v124 = 8 * uLayingItemID; | |
1655 LOBYTE(v124) = v124 | 2; | |
1656 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1657 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
1658 return 0; | |
1659 } | |
1660 | |
1661 case 4092: | |
1662 { | |
1663 pSpriteObjects[uLayingItemID].uType = 4091; | |
1664 v83 = 0; | |
1665 for (v81 = 0; v81 < (signed int)pObjectList->uNumObjects; ++v81) | |
1666 { | |
1667 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v81].uObjectID) | |
1668 v83 = v81; | |
1669 } | |
1670 pSpriteObjects[uLayingItemID].uObjectDescID = v83; | |
1671 if (!v83) | |
1672 SpriteObject::OnInteraction(uLayingItemID); | |
1673 v134 = 0; | |
1674 //v72 = uLayingItemID; | |
1675 v132 = pSpriteObjects[uLayingItemID].field_61; | |
1676 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1677 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1678 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1679 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1680 AttackerInfo.Add(PID(OBJECT_Item, uLayingItemID), 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v132, v134); | |
1681 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
1682 v78 = 0; | |
1683 else | |
1684 v78 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1685 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1686 pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, 0, -1, 0, v78, 0, 0); | |
1687 return 0; | |
1688 } | |
1689 | |
1690 case 8010: | |
1691 { | |
1692 if (PID_TYPE(a2) == 3 | |
1693 && MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
1694 sub_43A97E(uLayingItemID, a2); | |
1695 ++pSpriteObjects[uLayingItemID].uType; | |
1696 //v9 = 0; | |
1697 v95 = 0; | |
1698 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
1699 { | |
1700 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
1701 v95 = v52; | |
1702 } | |
1703 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
1704 if (!v95) | |
1705 SpriteObject::OnInteraction(uLayingItemID); | |
1706 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
1707 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1708 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1709 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1710 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1711 if (!v96) | |
1712 v97 = 0; | |
1713 else | |
1714 v97 = (signed __int16)v96 + 4; | |
1715 v92 = uLayingItemID; | |
1716 v124 = 8 * v92; | |
1717 LOBYTE(v124) = v124 | 2; | |
1718 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1719 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
1720 return 0; | |
1721 } | |
1722 | |
1723 case 7030: | |
1724 case 7090: | |
1725 case 8000: | |
1726 case 8090: | |
1727 { | |
1728 sub_43A97E(uLayingItemID, a2); | |
1729 ++pSpriteObjects[uLayingItemID].uType; | |
1730 v95 = 0; | |
1731 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
1732 { | |
1733 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
1734 v95 = v52; | |
1735 } | |
1736 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
1737 if (!v95) | |
1738 SpriteObject::OnInteraction(uLayingItemID); | |
1739 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
1740 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1741 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1742 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1743 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1744 if (!v96) | |
1745 v97 = 0; | |
1746 else | |
1747 v97 = (signed __int16)v96 + 4; | |
1748 v124 = 8 * uLayingItemID; | |
1749 LOBYTE(v124) = v124 | 2; | |
1750 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1751 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
1752 return 0; | |
1753 } | |
1754 | |
1755 case 6040: | |
1756 case 8030: | |
1757 case 9030: | |
1758 { | |
1759 v143 = 17030; | |
1760 switch (pSpriteObjects[uLayingItemID].uType) | |
1761 { | |
1762 case 0x1798u: | |
1763 v143 = 15040; | |
1764 break; | |
1765 case 0xFAAu: | |
1766 v143 = 13010; | |
1767 break; | |
1768 case 0x2346u: | |
1769 v143 = 18030; | |
1770 break; | |
1771 } | |
1772 v138 = 1; | |
1773 if (PID_TYPE(a2) != OBJECT_Actor) | |
1774 { | |
1775 if (pSpriteObjects[uLayingItemID].uType != 9030 || pSpriteObjects[uLayingItemID].spell_skill != 4) | |
1776 { | |
1777 SpriteObject::OnInteraction(uLayingItemID); | |
1778 return 0; | |
1779 } | |
1780 pSpriteObjects[uLayingItemID]._46BEF1_apply_spells_aoe(); | |
1781 if (!v138) | |
1782 { | |
1783 ++pSpriteObjects[uLayingItemID].uType; | |
1784 v112 = 0; | |
1785 for (v110 = 0; v110 < (signed int)pObjectList->uNumObjects; ++v110) | |
1786 { | |
1787 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v110].uObjectID) | |
1788 v112 = v110; | |
1789 } | |
1790 pSpriteObjects[uLayingItemID].uObjectDescID = v112; | |
1791 if (!v112) | |
1792 SpriteObject::OnInteraction(uLayingItemID); | |
1793 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1794 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1795 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1796 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1797 v113 = pSpriteObjects[uLayingItemID].uSoundID; | |
1798 if (v113) | |
1799 v114 = (signed __int16)v113 + 4; | |
1800 else | |
1801 v114 = 0; | |
1802 v115 = 8 * uLayingItemID; | |
1803 LOBYTE(v115) = PID(OBJECT_Item, uLayingItemID); | |
1804 v125 = v143 + 1; | |
1805 pAudioPlayer->PlaySound((SoundID)v125, v115, 0, -1, 0, v114, 0, 0); | |
1806 } | |
1807 else | |
1808 SpriteObject::OnInteraction(uLayingItemID); | |
1809 return 0; | |
1810 } | |
1811 v106 = a2; | |
1812 v150 = 0; | |
1813 v139 = PID_ID(v106); | |
1814 v137 = pSpriteObjects[uLayingItemID].spell_level; | |
1815 v152 = pSpriteObjects[uLayingItemID].spell_skill; | |
1816 v136 = pSpriteObjects[uLayingItemID].spell_id; | |
1817 if (pSpriteObjects[uLayingItemID].uType == 9030) | |
1818 { | |
1819 v150 = 2; | |
1820 if (v152 == 2) | |
1821 { | |
1822 v150 = 3; | |
1823 } | |
1824 else | |
1825 { | |
1826 if (v152 >= 3) | |
1827 v150 = 4; | |
1828 } | |
1829 pActors[v139].uAttributes |= 0x80000; | |
1830 v107 = v135; | |
1831 } | |
1832 if (pSpriteObjects[uLayingItemID].uType == 6040) | |
1833 { | |
1834 v135 = 7; | |
1835 v107 = v135; | |
1836 } | |
1837 else | |
1838 { | |
1839 if (pSpriteObjects[uLayingItemID].uType == 8030) | |
1840 { | |
1841 v135 = 9; | |
1842 v107 = v135; | |
1843 } | |
1844 else | |
1845 { | |
1846 if (pSpriteObjects[uLayingItemID].uType != 9030) | |
1847 { | |
1848 v107 = v136; | |
1849 } | |
1850 if (pSpriteObjects[uLayingItemID].uType == 9030) | |
1851 { | |
1852 v135 = 10; | |
1853 v107 = v135; | |
1854 } | |
1855 } | |
1856 } | |
1857 if (pSpriteObjects[uLayingItemID].uType != 9030 || v152 != 4) | |
1858 { | |
1859 v108 = v139; | |
1860 if (pActors[v139].DoesDmgTypeDoDamage((DAMAGE_TYPE)v107)) | |
1861 { | |
1862 v138 = 0; | |
1863 if (pSpriteObjects[uLayingItemID].uType == 8030) | |
1864 { | |
1865 pActors[v108].uAIState = Standing; | |
1866 pActors[v108].UpdateAnimation(); | |
1867 } | |
1868 pActors[v108].pActorBuffs[v136].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335), | |
1869 v152, v150, 0, 0); | |
1870 } | |
1871 } | |
1872 else | |
1873 { | |
1874 pSpriteObjects[uLayingItemID]._46BEF1_apply_spells_aoe(); | |
1875 } | |
1876 pSpriteObjects[uLayingItemID].spell_level = 0; | |
1877 pSpriteObjects[uLayingItemID].spell_skill = 0; | |
1878 pSpriteObjects[uLayingItemID].spell_id = 0; | |
1879 if (!v138) | |
1880 { | |
1881 ++pSpriteObjects[uLayingItemID].uType; | |
1882 v112 = 0; | |
1883 for (v110 = 0; v110 < (signed int)pObjectList->uNumObjects; ++v110) | |
1884 { | |
1885 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v110].uObjectID) | |
1886 v112 = v110; | |
1887 } | |
1888 pSpriteObjects[uLayingItemID].uObjectDescID = v112; | |
1889 if (!v112) | |
1890 SpriteObject::OnInteraction(uLayingItemID); | |
1891 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1892 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1893 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1894 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1895 v113 = pSpriteObjects[uLayingItemID].uSoundID; | |
1896 if (v113) | |
1897 v114 = (signed __int16)v113 + 4; | |
1898 else | |
1899 v114 = 0; | |
1900 v115 = 8 * uLayingItemID; | |
1901 LOBYTE(v115) = PID(OBJECT_Item, uLayingItemID); | |
1902 v125 = v143 + 1; | |
1903 pAudioPlayer->PlaySound((SoundID)v125, v115, 0, -1, 0, v114, 0, 0); | |
1904 } | |
1905 else | |
1906 SpriteObject::OnInteraction(uLayingItemID); | |
1907 return 0; | |
1908 } | |
1909 | |
1910 case 9040: | |
1911 { | |
1912 sub_43A97E(uLayingItemID, a2); | |
1913 ++pSpriteObjects[uLayingItemID].uType; | |
1914 v95 = 0; | |
1915 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
1916 { | |
1917 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
1918 v95 = v52; | |
1919 } | |
1920 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
1921 if (!v95) | |
1922 SpriteObject::OnInteraction(uLayingItemID); | |
1923 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
1924 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1925 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1926 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1927 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1928 if (!v96) | |
1929 v97 = 0; | |
1930 else | |
1931 v97 = (signed __int16)v96 + 4; | |
1932 v124 = 8 * uLayingItemID; | |
1933 LOBYTE(v124) = v124 | 2; | |
1934 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1935 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
1936 return 0; | |
1937 } | |
1938 | |
1939 /* | |
1940 case 1080: | |
1941 case 2100: | |
1942 { | |
1943 if (PID_TYPE(a2) != 3) | |
1944 { | |
1945 //v32 = 0; | |
1946 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
1947 v46 = 0; | |
1948 for (v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146) | |
1949 { | |
1950 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID) | |
1951 v46 = v146; | |
1952 } | |
1953 pSpriteObjects[uLayingItemID].uObjectDescID = v46; | |
1954 if (!v46) | |
1955 SpriteObject::OnInteraction(uLayingItemID); | |
1956 v100 = pSpriteObjects[uLayingItemID].field_61; | |
1957 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
1958 v102 = 8 * uLayingItemID; | |
1959 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
1960 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
1961 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
1962 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
1963 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
1964 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
1965 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
1966 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
1967 v47 = 0; | |
1968 else | |
1969 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
1970 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
1971 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); | |
1972 return 0; | |
1973 } | |
1974 return 1; | |
1975 }*/ | |
1976 | |
1977 case 1080: | |
1978 case 2100: | |
1979 { | |
1980 if (PID_TYPE(a2) == 3) | |
1981 return 1; | |
1982 //else go to next case | |
1983 } | |
1984 | |
1985 case 1050: | |
1986 case 9080: | |
1987 { | |
1988 v95 = 0; | |
1989 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
1990 for (v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146) | |
1991 { | |
1992 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID) | |
1993 v95 = v146; | |
1994 } | |
1995 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
1996 if (!v95) | |
1997 SpriteObject::OnInteraction(uLayingItemID); | |
1998 v100 = pSpriteObjects[uLayingItemID].field_61; | |
1999 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2000 v102 = 8 * uLayingItemID; | |
2001 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
2002 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2003 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2004 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2005 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
2006 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
2007 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
2008 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
2009 v47 = 0; | |
2010 else | |
2011 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2012 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2013 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); | |
2014 return 0; | |
2015 } | |
2016 | |
2017 default: | |
2018 return 0; | |
2019 } | |
2020 | |
2021 } | |
2022 |