annotate SpriteObject.cpp @ 2484:cc7019a533fc

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