annotate Engine/Graphics/Viewport.cpp @ 2496:5abd8fc8f1c6

for ITEM_ARTIFACT_LADYS_ESCORT
author Ritor1
date Thu, 18 Sep 2014 17:38:54 +0600
parents
children 68cdef6879a0
rev   line source
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
4
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
6 #include "Viewport.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
7
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
8
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
9 #include "Party.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
10 #include "OurMath.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
11 #include "Actor.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
12 #include "Outdoor.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
13 #include "Events.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
14 #include "Mouse.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
15 #include "SpriteObject.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
16 #include "ObjectList.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
17 #include "DecorationList.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
18 #include "texts.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
19 #include "Game.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
20 #include "Vis.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
21 #include "LOD.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
22 #include "GUIWindow.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
23 #include "TurnEngine.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
24 #include "stru123.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
25 #include "MM7.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
26 #include "Engine/Graphics/Level/Decoration.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
27
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
28
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
29 //----- (004C0262) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
30 void Viewport::SetScreen( signed int sTL_X, signed int sTL_Y, signed int sBR_X, signed int sBR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
31 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
32 unsigned int tl_x; // edx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
33 unsigned int br_x; // esi@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
34 unsigned int tl_y; // edi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
35 unsigned int br_y; // eax@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
36
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
37 tl_x = sTL_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
38 br_x = sBR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
39 if ( sTL_X > sBR_X )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
40 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
41 br_x = sTL_X; // swap x's
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
42 tl_x = sBR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
43 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
44 tl_y = sTL_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
45 br_y = sBR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
46 if ( sTL_Y > sBR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
47 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
48 br_y = sTL_Y; // swap y's
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
49 tl_y = sBR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
50 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
51 this->uScreen_TL_X = tl_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
52 this->uScreen_TL_Y = tl_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
53 this->uScreen_BR_X = br_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
54 this->uScreen_BR_Y = br_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
55 this->uScreenWidth = br_x - tl_x + 1;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
56 this->uScreenHeight = br_y - tl_y + 1;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
57 this->uScreenCenterX = (signed int)(br_x + tl_x) /2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
58 //if ( pRenderer->pRenderD3D == 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
59 // this->uScreenCenterY = this->uScreen_BR_Y - fixpoint_mul(field_30, uScreenHeight);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
60 //else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
61 this->uScreenCenterY = (br_y + tl_y)/2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
62 SetViewport(this->uScreen_TL_X, this->uScreen_TL_Y, this->uScreen_BR_X, this->uScreen_BR_Y);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
63 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
64
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
65 //----- (004C02F8) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
66 void Viewport::SetFOV(int field_of_view)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
67 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
68 this->field_of_view = field_of_view;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
69 SetScreen(uScreen_TL_X, uScreen_TL_Y, uScreen_BR_X, uScreen_BR_Y);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
70 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
71
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
72 //----- (004C0312) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
73 void Viewport::SetViewport( signed int sTL_X, signed int sTL_Y, signed int sBR_X, signed int sBR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
74 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
75 signed int tl_x; // ebx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
76 signed int tl_y; // edi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
77 signed int br_x; // edx@5
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
78 signed int br_y; // eax@7
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
79
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
80 tl_x = sTL_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
81 if ( sTL_X < this->uScreen_TL_X )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
82 tl_x = this->uScreen_TL_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
83 tl_y = sTL_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
84 if ( sTL_Y < this->uScreen_TL_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
85 tl_y = this->uScreen_TL_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
86 br_x = sBR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
87 if ( sBR_X > this->uScreen_BR_X )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
88 br_x = this->uScreen_BR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
89 br_y = sBR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
90 if ( sBR_Y > this->uScreen_BR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
91 br_y = this->uScreen_BR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
92 this->uViewportTL_Y = tl_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
93 this->uViewportTL_X = tl_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
94 this->uViewportBR_X = br_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
95 this->uViewportBR_Y = br_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
96 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
97
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
98 //----- (00443219) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
99 void ViewingParams::_443219()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
100 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
101 this->sViewCenterY += 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
102
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
103 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
104 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
105
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
106 //----- (00443225) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
107 void ViewingParams::_443225()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
108 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
109 this->sViewCenterX -= 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
110
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
111 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
112 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
113
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
114 //----- (00443231) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
115 void ViewingParams::_443231()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
116 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
117 this->sViewCenterY -= 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
118
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
119 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
120 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
121
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
122 //----- (0044323D) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
123 void ViewingParams::_44323D()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
124 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
125 this->sViewCenterX += 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
126
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
127 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
128 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
129
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
130 //----- (00443249) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
131 void ViewingParams::CenterOnParty()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
132 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
133 this->uMapBookMapZoom = fixpoint_mul(0x8000, this->uMapBookMapZoom);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
134 if (this->uMapBookMapZoom < 384)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
135 this->uMapBookMapZoom = 384;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
136
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
137 this->sViewCenterX = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
138 this->sViewCenterY = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
139
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
140 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
141 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
142
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
143 //----- (00443291) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
144 void ViewingParams::CenterOnParty2()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
145 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
146 int v2; // eax@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
147
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
148 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
149 v2 = 1536;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
150 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
151 v2 = 3072;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
152 else assert(false);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
153
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
154 this->uMapBookMapZoom *= 2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
155 if (this->uMapBookMapZoom > v2 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
156 this->uMapBookMapZoom = v2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
157
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
158 this->sViewCenterX = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
159 this->sViewCenterY = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
160 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
161 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
162
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
163 //----- (004432E7) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
164 void ViewingParams::AdjustPosition()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
165 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
166 ViewingParams *v1; // esi@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
167 int v2; // ebx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
168 signed int v3; // edx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
169 int v4; // ecx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
170 int v5; // edi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
171 int v6; // eax@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
172 int v7; // eax@5
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
173
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
174
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
175 v1 = this;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
176 v2 = this->indoor_center_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
177 v3 = 88 >> (this->uMapBookMapZoom / 384);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
178 v4 = (44 - v3) << 9;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
179 if ( v1->sViewCenterY > v2 + v4 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
180 v1->sViewCenterY = v2 + v4;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
181
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
182 v5 = v1->indoor_center_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
183 v6 = (v3 - 44) << 9;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
184 if ( v1->sViewCenterX < v5 + v6 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
185 v1->sViewCenterX = v5 + v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
186
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
187 v7 = v2 + v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
188 if ( v1->sViewCenterY < v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
189 v1->sViewCenterY = v7;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
190
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
191 if ( v1->sViewCenterX > v5 + v4 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
192 v1->sViewCenterX = v5 + v4;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
193 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
194
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
195 //----- (00443343) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
196 void ViewingParams::InitGrayPalette()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
197 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
198 for (unsigned short i=0; i<256; ++i)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
199 pPalette[i]=Color16(i, i, i);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
200 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
201
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
202 //----- (00443365) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
203 void ViewingParams::_443365()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
204 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
205 Vec3_short_ *v3; // eax@4
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
206 Vec3_short_ *v6; // eax@12
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
207 int minimum_y; // [sp+10h] [bp-10h]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
208 int maximum_y; // [sp+14h] [bp-Ch]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
209 int minimum_x; // [sp+18h] [bp-8h]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
210 int maximum_x; // [sp+1Ch] [bp-4h]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
211
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
212 InitGrayPalette();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
213 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
214 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
215 minimum_x = 0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
216 minimum_y = 0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
217
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
218 maximum_x = -0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
219 maximum_y = -0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
220 for (int i=0; i<pIndoor->pMapOutlines->uNumOutlines; ++i)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
221 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
222 v3 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace1ID];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
223
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
224 if ( v3->x < minimum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
225 minimum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
226 if ( v3->x > maximum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
227 maximum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
228 if ( v3->y < minimum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
229 minimum_y = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
230 if ( v3->y > maximum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
231 maximum_y = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
232
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
233 v6 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace2ID];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
234
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
235 if ( v6->x < minimum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
236 minimum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
237 if ( v6->x > maximum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
238 maximum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
239
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
240 if ( v6->y < minimum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
241 minimum_y = v3->y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
242 if ( v6->y > maximum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
243 maximum_y = v3->y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
244 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
245
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
246 uMinimapZoom = 1024;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
247 indoor_center_x = (signed int)(minimum_x + maximum_x) / 2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
248 field_28 = 10;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
249 indoor_center_y = (signed int)(minimum_y + maximum_y) / 2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
250 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
251 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
252 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
253 indoor_center_x = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
254 indoor_center_y = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
255 uMinimapZoom = _576E2C_current_minimap_zoom;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
256 field_28 = dword_576E28;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
257 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
258 uMapBookMapZoom = 384;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
259 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
260 //----- (0042213C) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
261 void OnGameViewportClick()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
262 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
263 signed int v0; // ebx@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
264 POINT *v1; // esi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
265 signed int v6; // eax@14
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
266 char *v7; // esi@15
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
267 int v9; // eax@19
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
268 unsigned int pTextureID; // eax@19
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
269 int pEventID; // ecx@21
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
270 int v15; // ecx@29
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
271 // signed int v16; // edx@30
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
272 // int v18; // ebx@47
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
273 // signed int v21; // eax@58
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
274 SpriteObject a1; // [sp+Ch] [bp-80h]@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
275 POINT a2; // [sp+84h] [bp-8h]@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
276
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
277 int clickable_distance = 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
278
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
279 v1 = pMouse->GetCursorPos(&a2);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
280 //if ( pRenderer->pRenderD3D )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
281 v0 = pGame->pVisInstance->get_picked_object_zbuf_val();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
282 //else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
283 // v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[v1->y]];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
284
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
285 if ( PID_TYPE(v0) == OBJECT_Item)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
286 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
287 int item_id = PID_ID(v0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
288 //v21 = (signed int)(unsigned __int16)v0 >> 3;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
289 if ( !(pObjectList->pObjects[pSpriteObjects[item_id].uObjectDescID].uFlags & 0x10) && item_id < 1000 && pSpriteObjects[item_id].uObjectDescID
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
290 && (unsigned int)v0 < 0x2000000 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
291 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
292 if ( pSpriteObjects[item_id].stru_24.GetItemEquipType() == 18 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
293 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
294 pParty->PartyFindsGold(pSpriteObjects[item_id].stru_24.uSpecEnchantmentType, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
295 viewparams->bRedrawGameUI = 1;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
296 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
297 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
298 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
299 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[pSpriteObjects[item_id].stru_24.uItemID].pUnidentifiedName);//You found an item (%s)!
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
300 ShowStatusBarString(pTmpBuf2.data(), 2);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
301 if ( pSpriteObjects[item_id].stru_24.uItemID == ITEM_ARTIFACT_SPLITTER )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
302 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
303 if ( pSpriteObjects[item_id].stru_24.uItemID == 455 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
304 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
305 if ( !pParty->AddItemToParty(&pSpriteObjects[item_id].stru_24) )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
306 pParty->SetHoldingItem(&pSpriteObjects[item_id].stru_24);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
307 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
308 SpriteObject::OnInteraction(item_id);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
309 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
310 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
311 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
312 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
313 __debugbreak();//no checker
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
314 v6 = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
315 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
316 if ( (signed int)pObjectList->uNumObjects <= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
317 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
318 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
319 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
320 v7 = (char *)&pObjectList->pObjects->uObjectID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
321 while ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
322 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
323 ++v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
324 v7 += 56;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
325 if ( v6 >= (signed int)pObjectList->uNumObjects )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
326 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
327 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
328 break;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
329 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
330 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
331 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
332 a1.uObjectDescID = v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
333 a1.vPosition.y = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
334 a1.spell_caster_pid = OBJECT_Player;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
335 a1.vPosition.x = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
336 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
337 a1.uSoundID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
338 a1.uFacing = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
339 a1.uAttributes = 8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
340 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
341 a1.uSpriteFrameID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
342 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
343
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
344 extern int UnprojectX(int);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
345 //v9 = UnprojectX(v1->x);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
346 a1.Create(pParty->sRotationY + UnprojectX(v1->x), 184, 200, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
347 pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
348 if (pTextureID != -1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
349 pIcons_LOD->pTextures[pTextureID].Release();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
350 pMouse->RemoveHoldingItem();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
351 pIcons_LOD->SyncLoadedFilesCount();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
352 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
353 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
354 if ( PID_TYPE(v0) == OBJECT_Actor)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
355 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
356 int mon_id = PID_ID(v0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
357 //a2.y = v16;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
358 if ( pActors[mon_id].uAIState == Dead )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
359 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
360 if ( (unsigned int)v0 < 0x2000000 )//distance limit for loot monster
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
361 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
362 pActors[mon_id].LootActor();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
363 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
364 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
365 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
366 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
367 __debugbreak();//no checker
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
368 v6 = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
369 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
370 if ( (signed int)pObjectList->uNumObjects <= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
371 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
372 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
373 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
374 v7 = (char *)&pObjectList->pObjects->uObjectID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
375 while ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
376 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
377 ++v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
378 v7 += 56;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
379 if ( v6 >= (signed int)pObjectList->uNumObjects )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
380 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
381 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
382 break;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
383 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
384 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
385 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
386 a1.uObjectDescID = v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
387 a1.vPosition.y = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
388 a1.spell_caster_pid = OBJECT_Player;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
389 a1.vPosition.x = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
390 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
391 a1.uSoundID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
392 a1.uFacing = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
393 a1.uAttributes = 8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
394 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
395 a1.uSpriteFrameID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
396 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
397
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
398 extern int UnprojectX(int);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
399 //v9 = UnprojectX(v1->x);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
400 a1.Create(pParty->sRotationY + UnprojectX(v1->x), 184, 200, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
401 pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
402 if (pTextureID != -1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
403 pIcons_LOD->pTextures[pTextureID].Release();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
404 pMouse->RemoveHoldingItem();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
405 pIcons_LOD->SyncLoadedFilesCount();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
406 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
407 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
408 if ( GetAsyncKeyState(VK_SHIFT) >= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
409 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
410 if ( !pActors[mon_id].GetActorsRelation(0) && pActors[mon_id].ActorFriend() )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
411 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
412 if ( HIWORD(v0) >= clickable_distance)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
413 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
414 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
415 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
416 __debugbreak();//no checker
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
417 v6 = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
418 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
419 if ( (signed int)pObjectList->uNumObjects <= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
420 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
421 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
422 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
423 v7 = (char *)&pObjectList->pObjects->uObjectID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
424 while ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
425 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
426 ++v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
427 v7 += 56;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
428 if ( v6 >= (signed int)pObjectList->uNumObjects )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
429 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
430 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
431 break;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
432 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
433 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
434 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
435 a1.uObjectDescID = v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
436 a1.vPosition.y = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
437 a1.spell_caster_pid = OBJECT_Player;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
438 a1.vPosition.x = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
439 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
440 a1.uSoundID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
441 a1.uFacing = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
442 a1.uAttributes = 8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
443 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
444 a1.uSpriteFrameID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
445 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
446
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
447 extern int UnprojectX(int);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
448 //v9 = UnprojectX(v1->x);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
449 a1.Create(pParty->sRotationY + UnprojectX(v1->x), 184, 200, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
450 pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
451 if (pTextureID != -1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
452 pIcons_LOD->pTextures[pTextureID].Release();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
453 pMouse->RemoveHoldingItem();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
454 pIcons_LOD->SyncLoadedFilesCount();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
455 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
456 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
457 if ( !pActors[mon_id].CanAct() )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
458 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
459 //v18 = mon_id;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
460 Actor::AI_FaceObject(mon_id, 4, 0, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
461 if ( !pActors[mon_id].sNPC_ID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
462 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
463 if ( pNPCStats->pGroups_copy[pActors[mon_id].uGroup] )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
464 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
465 if ( pNPCStats->pCatchPhrases[pNPCStats->pGroups_copy[pActors[mon_id].uGroup]] )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
466 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
467 pParty->uFlags |= 2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
468 strcpy(byte_5B0938.data(), pNPCStats->pCatchPhrases[pNPCStats->pGroups_copy[pActors[mon_id].uGroup]]);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
469 sub_4451A8_press_any_key(0, 0, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
470 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
471 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
472 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
473 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
474 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_StartNPCDialogue, mon_id, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
475 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
476 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
477 if ( pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
478 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
479 pTurnEngine->field_18 |= TE_FLAG_8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
480 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
481 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
482 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
483 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
484 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
485 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
486 if ( pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
487 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
488 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
489 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
490 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
491 if ( uActiveCharacter && sub_427769_isSpellQuickCastableOnShiftClick(pPlayers[uActiveCharacter]->uQuickSpell))
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
492 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_CastQuickSpell, 0, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
493 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
494 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
495 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
496 if ( PID_TYPE(v0) == OBJECT_Decoration)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
497 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
498 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].uDecorationDescID].uRadius) >= clickable_distance )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
499 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
500 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
501 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
502 __debugbreak();//no checker
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
503 v6 = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
504 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
505 if ( (signed int)pObjectList->uNumObjects <= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
506 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
507 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
508 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
509 v7 = (char *)&pObjectList->pObjects->uObjectID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
510 while ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
511 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
512 ++v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
513 v7 += 56;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
514 if ( v6 >= (signed int)pObjectList->uNumObjects )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
515 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
516 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
517 break;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
518 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
519 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
520 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
521 a1.uObjectDescID = v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
522 a1.vPosition.y = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
523 a1.spell_caster_pid = OBJECT_Player;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
524 a1.vPosition.x = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
525 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
526 a1.uSoundID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
527 a1.uFacing = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
528 a1.uAttributes = 8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
529 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
530 a1.uSpriteFrameID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
531 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
532
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
533 extern int UnprojectX(int);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
534 //v9 = UnprojectX(v1->x);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
535 a1.Create(pParty->sRotationY + UnprojectX(v1->x), 184, 200, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
536 pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
537 if (pTextureID != -1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
538 pIcons_LOD->pTextures[pTextureID].Release();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
539 pMouse->RemoveHoldingItem();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
540 pIcons_LOD->SyncLoadedFilesCount();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
541 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
542 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
543 if ( !pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].uEventID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
544 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
545 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
546 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
547 v15 = stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]._idx_in_stru123 - 75] + 380;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
548 activeLevelDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
549 EventProcessor(v15, 0, 1);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
550 activeLevelDecoration = nullptr;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
551 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
552 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
553 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
554 pEventID = pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].uEventID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
555 EventProcessor(pEventID, (unsigned __int16)v0, 1);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
556 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
557 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
558 if ( PID_TYPE(v0) == OBJECT_BModel && HIWORD(v0) < clickable_distance)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
559 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
560 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
561 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
562 if ( !pIndoor->pFaces[PID_ID(v0)].Clickable() )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
563 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
564 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
565 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
566 ShowNothingHereStatus();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
567 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
568 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
569 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
570 __debugbreak();//no checker
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
571 v6 = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
572 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
573 if ( (signed int)pObjectList->uNumObjects <= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
574 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
575 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
576 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
577 v7 = (char *)&pObjectList->pObjects->uObjectID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
578 while ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
579 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
580 ++v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
581 v7 += 56;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
582 if ( v6 >= (signed int)pObjectList->uNumObjects )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
583 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
584 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
585 break;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
586 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
587 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
588 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
589 a1.uObjectDescID = v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
590 a1.vPosition.y = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
591 a1.spell_caster_pid = OBJECT_Player;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
592 a1.vPosition.x = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
593 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
594 a1.uSoundID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
595 a1.uFacing = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
596 a1.uAttributes = 8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
597 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
598 a1.uSpriteFrameID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
599 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
600
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
601 extern int UnprojectX(int);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
602 v9 = UnprojectX(v1->x);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
603 a1.Create(pParty->sRotationY + v9, 184, 200, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
604 pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
605 if (pTextureID != -1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
606 pIcons_LOD->pTextures[pTextureID].Release();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
607 pMouse->RemoveHoldingItem();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
608 pIcons_LOD->SyncLoadedFilesCount();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
609 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
610 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
611 pEventID = pIndoor->pFaceExtras[pIndoor->pFaces[PID_ID(v0)].uFaceExtraID].uEventID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
612 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
613 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
614 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
615 if ( !pOutdoor->pBModels[(signed int)(v0 & 0xFFFF) >> 9].pFaces[PID_ID(v0) & 0x3F].Clickable())
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
616 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
617 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
618 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
619 ShowNothingHereStatus();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
620 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
621 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
622 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
623 __debugbreak();//no checker
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
624 v6 = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
625 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
626 if ( (signed int)pObjectList->uNumObjects <= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
627 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
628 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
629 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
630 v7 = (char *)&pObjectList->pObjects->uObjectID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
631 while ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
632 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
633 ++v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
634 v7 += 56;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
635 if ( v6 >= (signed int)pObjectList->uNumObjects )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
636 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
637 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
638 break;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
639 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
640 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
641 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
642 a1.uObjectDescID = v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
643 a1.vPosition.y = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
644 a1.spell_caster_pid = OBJECT_Player;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
645 a1.vPosition.x = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
646 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
647 a1.uSoundID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
648 a1.uFacing = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
649 a1.uAttributes = 8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
650 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
651 a1.uSpriteFrameID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
652 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
653
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
654 extern int UnprojectX(int);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
655 v9 = UnprojectX(v1->x);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
656 a1.Create(pParty->sRotationY + v9, 184, 200, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
657 pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
658 if (pTextureID != -1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
659 pIcons_LOD->pTextures[pTextureID].Release();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
660 pMouse->RemoveHoldingItem();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
661 pIcons_LOD->SyncLoadedFilesCount();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
662 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
663 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
664 pEventID = pOutdoor->pBModels[(signed int)(v0 & 0xFFFF) >> 9].pFaces[PID_ID(v0) & 0x3F].sCogTriggeredID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
665 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
666 EventProcessor(pEventID, (unsigned __int16)v0, 1);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
667 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
668 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
669 if ( PID_TYPE(v0) != OBJECT_BModel || HIWORD(v0) >= clickable_distance )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
670 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
671 if ( !pParty->pPickedItem.uItemID )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
672 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
673 //__debugbreak();//no checker
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
674 v6 = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
675 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
676 if ( (signed int)pObjectList->uNumObjects <= 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
677 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
678 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
679 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
680 v7 = (char *)&pObjectList->pObjects->uObjectID;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
681 while ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
682 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
683 ++v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
684 v7 += 56;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
685 if ( v6 >= (signed int)pObjectList->uNumObjects )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
686 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
687 LOWORD(v6) = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
688 break;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
689 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
690 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
691 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
692 a1.uObjectDescID = v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
693 a1.vPosition.y = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
694 a1.spell_caster_pid = OBJECT_Player;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
695 a1.vPosition.x = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
696 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
697 a1.uSoundID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
698 a1.uFacing = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
699 a1.uAttributes = 8;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
700 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
701 a1.uSpriteFrameID = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
702 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
703
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
704 extern int UnprojectX(int);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
705 //v9 = UnprojectX(v1->x);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
706 a1.Create(pParty->sRotationY + UnprojectX(v1->x), 184, 200, 0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
707 pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
708 if (pTextureID != -1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
709 pIcons_LOD->pTextures[pTextureID].Release();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
710 pMouse->RemoveHoldingItem();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
711 pIcons_LOD->SyncLoadedFilesCount();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
712 return;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
713 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
714 }