annotate SpriteObject.cpp @ 2486:1e70f8470638

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