annotate mm7_5.cpp @ 1297:5450af4f57ef

moving files mm7_x ending
author Ritor1
date Wed, 19 Jun 2013 17:06:58 +0600
parents c423f946dc99
children 8c2f689b5f0b
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1160
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1160
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1160
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1160
diff changeset
4
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
5 #include <assert.h>
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
6
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
7 #include "Texture.h"
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
8 #include "mm7_data.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
9 #include "VideoPlayer.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
10 #include "Sprites.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
11 #include "MapInfo.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
12 #include "BSPModel.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
13 #include "OutdoorCamera.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
14 #include "LightmapBuilder.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
15 #include "DecalBuilder.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
16 #include "Mouse.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
17 #include "Keyboard.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
18 #include "GammaControl.h"
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
19 #include "stru11.h"
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1254
diff changeset
20 #include "mm7_data.h"
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1254
diff changeset
21 #include "FactionTable.h"
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 1000
diff changeset
22 #include "Vis.h"
0
Ritor1
parents:
diff changeset
23 #include "mm7.h"
Ritor1
parents:
diff changeset
24 #include "Game.h"
Ritor1
parents:
diff changeset
25 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
26 #include "GUIFont.h"
Ritor1
parents:
diff changeset
27 #include "GUIProgressBar.h"
Ritor1
parents:
diff changeset
28 #include "Party.h"
Ritor1
parents:
diff changeset
29 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
30 #include "Outdoor.h"
Ritor1
parents:
diff changeset
31 #include "Arcomage.h"
Ritor1
parents:
diff changeset
32 #include "LOD.h"
Ritor1
parents:
diff changeset
33 #include "Actor.h"
Ritor1
parents:
diff changeset
34 #include "Events.h"
Ritor1
parents:
diff changeset
35 #include "Viewport.h"
Ritor1
parents:
diff changeset
36 #include "FrameTableInc.h"
Ritor1
parents:
diff changeset
37 #include "Math.h"
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
38 #include "SpriteObject.h"
0
Ritor1
parents:
diff changeset
39 #include "ObjectList.h"
Ritor1
parents:
diff changeset
40 #include "Chest.h"
Ritor1
parents:
diff changeset
41 #include "PaletteManager.h"
Ritor1
parents:
diff changeset
42 #include "SaveLoad.h"
Ritor1
parents:
diff changeset
43 #include "Time.h"
Ritor1
parents:
diff changeset
44 #include "TurnEngine.h"
924
a78f08dbeb88 CastSpellInfo
Ritor1
parents: 921
diff changeset
45 #include "CastSpellInfo.h"
0
Ritor1
parents:
diff changeset
46 #include "stru298.h"
Ritor1
parents:
diff changeset
47 #include "Events2D.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 165
diff changeset
48 #include "texts.h"
0
Ritor1
parents:
diff changeset
49 #include "Log.h"
629
59713bb36033 houses func moved to uihouses
Gloval
parents: 618
diff changeset
50 #include "UIHouses.h"
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
51 #include "Lights.h"
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
52 #include "Lights.h"
0
Ritor1
parents:
diff changeset
53
Ritor1
parents:
diff changeset
54 //----- (004304E7) --------------------------------------------------------
Ritor1
parents:
diff changeset
55 void __cdecl GameUI_MsgProc()
Ritor1
parents:
diff changeset
56 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
57 //signed int v0; // edi@6
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
58 //char *v1; // esi@6
0
Ritor1
parents:
diff changeset
59 unsigned int v2; // edx@7
Ritor1
parents:
diff changeset
60 Actor *pActor; // ecx@13
Ritor1
parents:
diff changeset
61 int v4; // ecx@18
199
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
62 //NPCData *pNPCData0; // eax@18
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
63 //int v6; // edx@20
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
64 //int v7; // ecx@29
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
65 //unsigned int v8; // edx@59
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
66 //unsigned int v9; // ecx@60
0
Ritor1
parents:
diff changeset
67 unsigned int v10; // ecx@73
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
68 //unsigned int v11; // eax@75
0
Ritor1
parents:
diff changeset
69 unsigned __int8 v12; // sf@75
Ritor1
parents:
diff changeset
70 unsigned __int8 v13; // of@75
Ritor1
parents:
diff changeset
71 int v14; // eax@98
Ritor1
parents:
diff changeset
72 unsigned int v15; // eax@102
Ritor1
parents:
diff changeset
73 unsigned __int8 v16; // al@104
Ritor1
parents:
diff changeset
74 unsigned __int8 v17; // al@105
Ritor1
parents:
diff changeset
75 int v18; // eax@106
Ritor1
parents:
diff changeset
76 float v19; // ST64_4@121
Ritor1
parents:
diff changeset
77 unsigned int v20; // ecx@121
Ritor1
parents:
diff changeset
78 float v21; // ST64_4@126
Ritor1
parents:
diff changeset
79 float v22; // ST64_4@127
Ritor1
parents:
diff changeset
80 unsigned int v23; // ecx@135
Ritor1
parents:
diff changeset
81 unsigned int v24; // ecx@149
Ritor1
parents:
diff changeset
82 unsigned int v25; // ecx@165
Ritor1
parents:
diff changeset
83 GUIWindow *pWindow; // eax@204
Ritor1
parents:
diff changeset
84 unsigned int v27; // edx@204
Ritor1
parents:
diff changeset
85 unsigned int v28; // ecx@204
Ritor1
parents:
diff changeset
86 GUIWindow *pWindow2; // ecx@248
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
87 //int v30; // edx@258
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
88 //const char *v31; // ecx@262
0
Ritor1
parents:
diff changeset
89 signed int v32; // eax@269
Ritor1
parents:
diff changeset
90 unsigned int v33; // eax@277
Ritor1
parents:
diff changeset
91 unsigned __int8 v34; // al@279
Ritor1
parents:
diff changeset
92 unsigned __int8 v35; // al@280
1000
Ritor1
parents: 999
diff changeset
93 //GUIWindow *pWindow3; // ecx@332
0
Ritor1
parents:
diff changeset
94 int v37; // eax@341
Ritor1
parents:
diff changeset
95 int v38; // eax@358
Ritor1
parents:
diff changeset
96 SHORT v39; // ax@365
910
Ritor1
parents: 907
diff changeset
97 //signed int v40; // eax@365
0
Ritor1
parents:
diff changeset
98 char *v41; // eax@380
Ritor1
parents:
diff changeset
99 int v42; // eax@396
Ritor1
parents:
diff changeset
100 POINT *pPoint; // eax@397
Ritor1
parents:
diff changeset
101 signed int v44; // eax@398
Ritor1
parents:
diff changeset
102 int v45; // edx@398
Ritor1
parents:
diff changeset
103 signed int v46; // ecx@398
Ritor1
parents:
diff changeset
104 char v47; // zf@399
Ritor1
parents:
diff changeset
105 char v48; // zf@405
Ritor1
parents:
diff changeset
106 BLVFace *pBLVFace; // ecx@410
Ritor1
parents:
diff changeset
107 ODMFace *pODMFace; // ecx@412
1000
Ritor1
parents: 999
diff changeset
108 CastSpellInfo *pSpellInfo; // ecx@415
0
Ritor1
parents:
diff changeset
109 void *v52; // eax@424
Ritor1
parents:
diff changeset
110 __int16 v53; // ax@431
Ritor1
parents:
diff changeset
111 int v54; // eax@432
Ritor1
parents:
diff changeset
112 int v55; // ecx@432
Ritor1
parents:
diff changeset
113 int v56; // edx@432
Ritor1
parents:
diff changeset
114 int v57; // eax@432
Ritor1
parents:
diff changeset
115 Player *pPlayer; // edx@442
Ritor1
parents:
diff changeset
116 unsigned int v59; // eax@445
Ritor1
parents:
diff changeset
117 signed int v60; // ST64_4@459
Ritor1
parents:
diff changeset
118 NPCData *pNPCData2; // eax@467
Ritor1
parents:
diff changeset
119 unsigned __int64 v62; // kr00_8@467
Ritor1
parents:
diff changeset
120 __int16 v63; // dx@479
Ritor1
parents:
diff changeset
121 unsigned int v64; // eax@486
Ritor1
parents:
diff changeset
122 int v65; // ecx@486
Ritor1
parents:
diff changeset
123 int v66; // eax@488
Ritor1
parents:
diff changeset
124 char *v67; // eax@489
Ritor1
parents:
diff changeset
125 __int16 v68; // dx@498
Ritor1
parents:
diff changeset
126 char *v69; // eax@512
Ritor1
parents:
diff changeset
127 int v70; // eax@525
Ritor1
parents:
diff changeset
128 int v71; // edi@527
Ritor1
parents:
diff changeset
129 NPCData *pNPCData3; // esi@527
Ritor1
parents:
diff changeset
130 char *v73; // ecx@533
Ritor1
parents:
diff changeset
131 signed int v74; // edi@535
Ritor1
parents:
diff changeset
132 int v75; // eax@535
Ritor1
parents:
diff changeset
133 int v76; // esi@535
Ritor1
parents:
diff changeset
134 int v77; // eax@537
Ritor1
parents:
diff changeset
135 Player *pPlayer2; // ecx@549
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
136 //int v79; // ecx@550
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
137 //unsigned int v80; // edx@550
0
Ritor1
parents:
diff changeset
138 signed int v81; // eax@552
Ritor1
parents:
diff changeset
139 POINT *pPoint2; // eax@553
Ritor1
parents:
diff changeset
140 signed int v83; // ecx@554
Ritor1
parents:
diff changeset
141 signed int v84; // ecx@554
Ritor1
parents:
diff changeset
142 GUIButton *pButton; // eax@578
Ritor1
parents:
diff changeset
143 unsigned int v86; // eax@583
Ritor1
parents:
diff changeset
144 const char *v87; // ecx@595
Ritor1
parents:
diff changeset
145 const char *v88; // ecx@596
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
146 //unsigned int v89; // eax@598
0
Ritor1
parents:
diff changeset
147 unsigned int v90; // eax@602
Ritor1
parents:
diff changeset
148 int v91; // edx@605
Ritor1
parents:
diff changeset
149 int v92; // eax@605
Ritor1
parents:
diff changeset
150 int v93; // edx@605
Ritor1
parents:
diff changeset
151 int pPlayerNum; // edx@611
Ritor1
parents:
diff changeset
152 int v95; // eax@611
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
153 //const char *v96; // ecx@621
0
Ritor1
parents:
diff changeset
154 unsigned int v97; // eax@624
Ritor1
parents:
diff changeset
155 int v98; // eax@636
Ritor1
parents:
diff changeset
156 unsigned __int8 v99; // al@643
Ritor1
parents:
diff changeset
157 Player *pPlayer3; // eax@648
Ritor1
parents:
diff changeset
158 int v101; // ecx@648
Ritor1
parents:
diff changeset
159 int v102; // edx@652
Ritor1
parents:
diff changeset
160 int v103; // eax@671
Ritor1
parents:
diff changeset
161 Player *pPlayer4; // ecx@718
Ritor1
parents:
diff changeset
162 int v105; // eax@718
Ritor1
parents:
diff changeset
163 Player *pPlayer5; // ST78_4@758
Ritor1
parents:
diff changeset
164 unsigned int v107; // eax@758
Ritor1
parents:
diff changeset
165 unsigned int v108; // eax@758
Ritor1
parents:
diff changeset
166 unsigned int v115; // eax@764
Ritor1
parents:
diff changeset
167 int v116; // eax@776
Ritor1
parents:
diff changeset
168 POINT *pPoint3; // eax@777
Ritor1
parents:
diff changeset
169 unsigned int v118; // eax@785
Ritor1
parents:
diff changeset
170 unsigned int v119; // ecx@786
Ritor1
parents:
diff changeset
171 unsigned int v120; // [sp-28h] [bp-624h]@86
Ritor1
parents:
diff changeset
172 unsigned int v121; // [sp-28h] [bp-624h]@711
Ritor1
parents:
diff changeset
173 unsigned int v122; // [sp-24h] [bp-620h]@86
Ritor1
parents:
diff changeset
174 unsigned int v123; // [sp-24h] [bp-620h]@711
Ritor1
parents:
diff changeset
175 unsigned int v124; // [sp-20h] [bp-61Ch]@86
Ritor1
parents:
diff changeset
176 unsigned int v125; // [sp-20h] [bp-61Ch]@711
Ritor1
parents:
diff changeset
177 unsigned int v126; // [sp-1Ch] [bp-618h]@86
Ritor1
parents:
diff changeset
178 int v127; // [sp-1Ch] [bp-618h]@107
Ritor1
parents:
diff changeset
179 unsigned int v128; // [sp-1Ch] [bp-618h]@711
Ritor1
parents:
diff changeset
180 int v129; // [sp-18h] [bp-614h]@86
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
181 //signed int v130; // [sp-18h] [bp-614h]@107
0
Ritor1
parents:
diff changeset
182 int v131; // [sp-14h] [bp-610h]@86
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
183 //unsigned int v132; // [sp-14h] [bp-610h]@107
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
184 //unsigned int v133; // [sp-10h] [bp-60Ch]@60
0
Ritor1
parents:
diff changeset
185 unsigned int v134; // [sp-10h] [bp-60Ch]@86
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
186 //signed int v135; // [sp-10h] [bp-60Ch]@107
0
Ritor1
parents:
diff changeset
187 unsigned int v136; // [sp-10h] [bp-60Ch]@121
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
188 //unsigned int v137; // [sp-Ch] [bp-608h]@60
0
Ritor1
parents:
diff changeset
189 unsigned int v138; // [sp-Ch] [bp-608h]@86
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
190 //signed int v139; // [sp-Ch] [bp-608h]@107
0
Ritor1
parents:
diff changeset
191 unsigned int v140; // [sp-Ch] [bp-608h]@121
Ritor1
parents:
diff changeset
192 enum WindowType pWindowType; // [sp-8h] [bp-604h]@56
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
193 //enum WindowType pWindowType1; // [sp-8h] [bp-604h]@60
0
Ritor1
parents:
diff changeset
194 unsigned __int8 v143; // [sp-8h] [bp-604h]@86
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
195 //int v144; // [sp-8h] [bp-604h]@107
0
Ritor1
parents:
diff changeset
196 enum WindowType pWindowType2; // [sp-8h] [bp-604h]@121
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
197 //const char *v146; // [sp-8h] [bp-604h]@449
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
198 //unsigned int v147; // [sp-8h] [bp-604h]@550
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
199 //int v148; // [sp-4h] [bp-600h]@56
0
Ritor1
parents:
diff changeset
200 GUIButton *pButton2; // [sp-4h] [bp-600h]@59
Ritor1
parents:
diff changeset
201 const char *v150; // [sp-4h] [bp-600h]@86
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
202 //unsigned int v151; // [sp-4h] [bp-600h]@107
0
Ritor1
parents:
diff changeset
203 int v152; // [sp-4h] [bp-600h]@121
Ritor1
parents:
diff changeset
204 int v153; // [sp-4h] [bp-600h]@135
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
205 //int v154; // [sp-4h] [bp-600h]@149
0
Ritor1
parents:
diff changeset
206 int v155; // [sp-4h] [bp-600h]@165
Ritor1
parents:
diff changeset
207 int v156; // [sp-4h] [bp-600h]@204
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
208 //const char *v157; // [sp-4h] [bp-600h]@444
0
Ritor1
parents:
diff changeset
209 unsigned int v158; // [sp-4h] [bp-600h]@449
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
210 //__int16 v159; // [sp-4h] [bp-600h]@550
0
Ritor1
parents:
diff changeset
211 int v160; // [sp-4h] [bp-600h]@599
Ritor1
parents:
diff changeset
212 const char *v161; // [sp-4h] [bp-600h]@637
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
213 //int v162; // [sp+0h] [bp-5FCh]@56
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
214 //int v163; // [sp+0h] [bp-5FCh]@59
0
Ritor1
parents:
diff changeset
215 Texture *pTexture; // [sp+0h] [bp-5FCh]@86
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
216 //int v165; // [sp+0h] [bp-5FCh]@107
0
Ritor1
parents:
diff changeset
217 int v166; // [sp+0h] [bp-5FCh]@121
Ritor1
parents:
diff changeset
218 int v167; // [sp+0h] [bp-5FCh]@135
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
219 //int v168; // [sp+0h] [bp-5FCh]@149
0
Ritor1
parents:
diff changeset
220 int v169; // [sp+0h] [bp-5FCh]@165
Ritor1
parents:
diff changeset
221 int v170; // [sp+0h] [bp-5FCh]@204
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
222 //signed int v171; // [sp+0h] [bp-5FCh]@259
0
Ritor1
parents:
diff changeset
223 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287
Ritor1
parents:
diff changeset
224 char *v173; // [sp+0h] [bp-5FCh]@444
Ritor1
parents:
diff changeset
225 char *v174; // [sp+0h] [bp-5FCh]@449
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
226 //int v175; // [sp+0h] [bp-5FCh]@550
0
Ritor1
parents:
diff changeset
227 int v176; // [sp+0h] [bp-5FCh]@599
Ritor1
parents:
diff changeset
228 const char *v177; // [sp+0h] [bp-5FCh]@629
Ritor1
parents:
diff changeset
229 char *v178; // [sp+0h] [bp-5FCh]@637
Ritor1
parents:
diff changeset
230 int v179; // [sp+4h] [bp-5F8h]@0
199
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
231 //signed int _this; // [sp+14h] [bp-5E8h]@22
0
Ritor1
parents:
diff changeset
232 signed int thisa; // [sp+14h] [bp-5E8h]@251
Ritor1
parents:
diff changeset
233 signed int thisb; // [sp+14h] [bp-5E8h]@272
Ritor1
parents:
diff changeset
234 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373
Ritor1
parents:
diff changeset
235 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377
Ritor1
parents:
diff changeset
236 char *thise; // [sp+14h] [bp-5E8h]@445
Ritor1
parents:
diff changeset
237 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455
Ritor1
parents:
diff changeset
238 int thisg; // [sp+14h] [bp-5E8h]@467
Ritor1
parents:
diff changeset
239 int thish; // [sp+14h] [bp-5E8h]@528
Ritor1
parents:
diff changeset
240 signed int thisi; // [sp+14h] [bp-5E8h]@535
Ritor1
parents:
diff changeset
241 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604
Ritor1
parents:
diff changeset
242 Player *pPlayer10; // [sp+14h] [bp-5E8h]@641
Ritor1
parents:
diff changeset
243 int thisl; // [sp+14h] [bp-5E8h]@648
Ritor1
parents:
diff changeset
244 int uMessageParam; // [sp+18h] [bp-5E4h]@7
Ritor1
parents:
diff changeset
245 int uAction; // [sp+1Ch] [bp-5E0h]@18
Ritor1
parents:
diff changeset
246 NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23
Ritor1
parents:
diff changeset
247 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18
Ritor1
parents:
diff changeset
248 char v197; // [sp+2Bh] [bp-5D1h]@101
Ritor1
parents:
diff changeset
249 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7
Ritor1
parents:
diff changeset
250 unsigned int v199; // [sp+30h] [bp-5CCh]@7
Ritor1
parents:
diff changeset
251 char *v200; // [sp+34h] [bp-5C8h]@518
Ritor1
parents:
diff changeset
252 POINT v201; // [sp+38h] [bp-5C4h]@553
Ritor1
parents:
diff changeset
253 POINT v202; // [sp+40h] [bp-5BCh]@141
Ritor1
parents:
diff changeset
254 POINT a2; // [sp+48h] [bp-5B4h]@127
Ritor1
parents:
diff changeset
255 POINT v204; // [sp+50h] [bp-5ACh]@777
Ritor1
parents:
diff changeset
256 POINT v205; // [sp+58h] [bp-5A4h]@171
Ritor1
parents:
diff changeset
257 POINT v206; // [sp+60h] [bp-59Ch]@553
Ritor1
parents:
diff changeset
258 POINT v207; // [sp+68h] [bp-594h]@155
Ritor1
parents:
diff changeset
259 POINT v208; // [sp+70h] [bp-58Ch]@397
Ritor1
parents:
diff changeset
260 POINT v209; // [sp+78h] [bp-584h]@777
Ritor1
parents:
diff changeset
261 POINT v210; // [sp+80h] [bp-57Ch]@397
Ritor1
parents:
diff changeset
262 POINT v211; // [sp+88h] [bp-574h]@704
Ritor1
parents:
diff changeset
263 __int64 v212; // [sp+90h] [bp-56Ch]@467
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
264 int v213; // [sp+98h] [bp-564h]@385
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
265 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
266 char pOut[32]; // [sp+BCh] [bp-540h]@370
0
Ritor1
parents:
diff changeset
267 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524
Ritor1
parents:
diff changeset
268 int v217[9]; // [sp+158h] [bp-4A4h]@652
Ritor1
parents:
diff changeset
269 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524
Ritor1
parents:
diff changeset
270 char a1[64]; // [sp+1F8h] [bp-404h]@467
Ritor1
parents:
diff changeset
271 char Str2[128]; // [sp+238h] [bp-3C4h]@527
Ritor1
parents:
diff changeset
272 Actor actor; // [sp+2B8h] [bp-344h]@4
Ritor1
parents:
diff changeset
273
Ritor1
parents:
diff changeset
274 dword_50CDC8 = 0;
Ritor1
parents:
diff changeset
275 if ( !pEventTimer->bPaused )
Ritor1
parents:
diff changeset
276 {
Ritor1
parents:
diff changeset
277 pParty->sEyelevel = pParty->uDefaultEyelevel;
Ritor1
parents:
diff changeset
278 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
Ritor1
parents:
diff changeset
279 }
Ritor1
parents:
diff changeset
280 if ( bDialogueUI_InitializeActor_NPC_ID )
Ritor1
parents:
diff changeset
281 {
Ritor1
parents:
diff changeset
282 //Actor::Actor(&actor);
Ritor1
parents:
diff changeset
283 memset(&actor, 0, 0x344u);
Ritor1
parents:
diff changeset
284 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID;
602
628694cd5744 Margaret working
zipi
parents: 600
diff changeset
285 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
286 GameUI_InitializeDialogue(&actor, false);
0
Ritor1
parents:
diff changeset
287 bDialogueUI_InitializeActor_NPC_ID = 0;
Ritor1
parents:
diff changeset
288 }
Ritor1
parents:
diff changeset
289 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
290 {
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
291 //v1 = "";
0
Ritor1
parents:
diff changeset
292 while ( 2 )
Ritor1
parents:
diff changeset
293 {
Ritor1
parents:
diff changeset
294 if ( !pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
295 break;
Ritor1
parents:
diff changeset
296
Ritor1
parents:
diff changeset
297 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199);
Ritor1
parents:
diff changeset
298 switch ( uMessage )
Ritor1
parents:
diff changeset
299 {
Ritor1
parents:
diff changeset
300 case UIMSG_ChangeGameState:
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
301 uGameState = GAME_FINISHED;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
302 continue;
0
Ritor1
parents:
diff changeset
303 case UIMSG_PlayArcomage:
Ritor1
parents:
diff changeset
304 pVideoPlayer->_4BF5B2();
Ritor1
parents:
diff changeset
305 pArcomageGame->bGameInProgress = 1;
Ritor1
parents:
diff changeset
306 PrepareArcomage();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
307 continue;
0
Ritor1
parents:
diff changeset
308 case UIMSG_StartNPCDialogue:
Ritor1
parents:
diff changeset
309 if ( !uActiveCharacter )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
310 continue;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
311 viewparams->field_48 = 1;
0
Ritor1
parents:
diff changeset
312 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
313 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
602
628694cd5744 Margaret working
zipi
parents: 600
diff changeset
314 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].sNPC_ID;
0
Ritor1
parents:
diff changeset
315 pActor = &pActors[uMessageParam];
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
316 //goto _actor_init_dlg;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
317 GameUI_InitializeDialogue(pActor, true);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
318 continue;
199
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
319 case UIMSG_StartHireling1Dialogue:
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
320 case UIMSG_StartHireling2Dialogue:
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
321 {
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
322 if (bNoNPCHiring || pCurrentScreen)
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
323 continue;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
324
0
Ritor1
parents:
diff changeset
325 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
326 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
327 uAction = 0;
201
30aa44013f7a On Items
Nomad
parents: 199
diff changeset
328 int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue;
0
Ritor1
parents:
diff changeset
329 v4 = 0;
199
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
330
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
331 for (uint i = 0; i < 2; ++i)
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
332 //pNPCData0 = pParty->pHirelings;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
333 //do
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
334 {
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
335 if (pParty->pHirelings[i].pName)
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
336 //{
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
337 //v6 = uAction++;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
338 pTmpBuf[uAction++] = i;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
339 //}
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
340 //++pNPCData0;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
341 //++v4;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
342 }
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
343 //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem );
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
344
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
345 //_this = 0;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
346 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
347 {
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
348 auto npc = pNPCStats->pNewNPCData + i;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
349 //do
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
350 //{
248
37dcbe8f3cca Dialogue stuff
Nomad
parents: 247
diff changeset
351 if (npc->Hired() &&
199
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
352 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) &&
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
353 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) )
0
Ritor1
parents:
diff changeset
354 {
199
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
355 //v7 =;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
356 pTmpBuf[uAction++] = i + 2;
0
Ritor1
parents:
diff changeset
357 }
199
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
358 //++_this;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
359 //++pNPCData4;
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
360 //}
66db86fa4ed2 Hireling dialogues
Nomad
parents: 198
diff changeset
361 //while ( _this < (signed int)pNPCStats->uNumNewNPCs );
0
Ritor1
parents:
diff changeset
362 }
201
30aa44013f7a On Items
Nomad
parents: 199
diff changeset
363
30aa44013f7a On Items
Nomad
parents: 199
diff changeset
364 if ( (signed int)(hireling_idx + (unsigned __int8)pParty->field_709) < uAction )
0
Ritor1
parents:
diff changeset
365 {
Ritor1
parents:
diff changeset
366 //Actor::Actor(&actor);
Ritor1
parents:
diff changeset
367 memset(&actor, 0, 0x344u);
602
628694cd5744 Margaret working
zipi
parents: 600
diff changeset
368 actor.sNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx;
0
Ritor1
parents:
diff changeset
369 pActor = &actor;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
370 GameUI_InitializeDialogue(&actor, true);
0
Ritor1
parents:
diff changeset
371 }
Ritor1
parents:
diff changeset
372 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
373 continue;
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 731
diff changeset
374
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 731
diff changeset
375 case UIMSG_BuyInShop_Identify_Repair:
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 731
diff changeset
376 UIShop_Buy_Identify_Repair();
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 731
diff changeset
377 continue;
467
Ritor1
parents: 457
diff changeset
378 case UIMSG_ClickNPCTopic:
Ritor1
parents: 457
diff changeset
379 ClickNPCTopic(uMessageParam);
Ritor1
parents: 457
diff changeset
380 continue;
651
2bf48d11d742 Training hall UI fixed
Nomad
parents: 649
diff changeset
381 case UIMSG_SelectShopDialogueOption:
2bf48d11d742 Training hall UI fixed
Nomad
parents: 649
diff changeset
382 OnSelectShopDialogueOption(uMessageParam);
2bf48d11d742 Training hall UI fixed
Nomad
parents: 649
diff changeset
383 continue;
2bf48d11d742 Training hall UI fixed
Nomad
parents: 649
diff changeset
384 case UIMSG_SelectNPCDialogueOption:
2bf48d11d742 Training hall UI fixed
Nomad
parents: 649
diff changeset
385 OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
386 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
387 case UIMSG_ClickHouseNPCPortrait:
0
Ritor1
parents:
diff changeset
388 _4B4224_UpdateNPCTopics(uMessageParam);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
389 continue;
0
Ritor1
parents:
diff changeset
390 case UIMSG_StartNewGame:
Ritor1
parents:
diff changeset
391 if ( dword_6BE138 == 124 || uMessageParam )
Ritor1
parents:
diff changeset
392 {
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
393 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
394 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
395 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
396 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
397 pGUIWindow_CurrentMenu->Release();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
398 uGameState = GAME_STATE_NEWGAME_OUT_GAMEMENU;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
399 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
400 viewparams->bRedrawGameUI = 1;
0
Ritor1
parents:
diff changeset
401 }
Ritor1
parents:
diff changeset
402 else
Ritor1
parents:
diff changeset
403 {
Ritor1
parents:
diff changeset
404 ShowStatusBarString(pGlobalTXT_LocalizationStrings[201], 2u);// "Are you sure? Click again to start a New Game"
Ritor1
parents:
diff changeset
405 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
406 dword_6BE138 = 124;
Ritor1
parents:
diff changeset
407 }
Ritor1
parents:
diff changeset
408 stru_506E40.Release();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
409 continue;
0
Ritor1
parents:
diff changeset
410 case UIMSG_Game_OpenLoadGameDialog:
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
411 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
412 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
413 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
414 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
415 pGUIWindow_CurrentMenu->Release();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
416 pCurrentScreen = SCREEN_LOADGAME;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
417 LoadUI_Load(1);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
418 continue;
0
Ritor1
parents:
diff changeset
419 case UIMSG_Quit:
Ritor1
parents:
diff changeset
420 if ( dword_6BE138 == 132 || uMessageParam )
Ritor1
parents:
diff changeset
421 {
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
422 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
423 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
424 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
425 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
426 pGUIWindow_CurrentMenu->Release();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
427 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
428 viewparams->bRedrawGameUI = 1;
0
Ritor1
parents:
diff changeset
429 if ( !uMessageParam )
Ritor1
parents:
diff changeset
430 pAudioPlayer->PlaySound((SoundID)(SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
431 uGameState = GAME_STATE_GAME_QUITTING_TO_MAIN_MENU;
0
Ritor1
parents:
diff changeset
432 }
Ritor1
parents:
diff changeset
433 else
Ritor1
parents:
diff changeset
434 {
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
435 ShowStatusBarString(pGlobalTXT_LocalizationStrings[82], 2);// "Are you sure? Click again to quit"
0
Ritor1
parents:
diff changeset
436 pAudioPlayer->PlaySound(SOUND_20001, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
437 dword_6BE138 = 132;
Ritor1
parents:
diff changeset
438 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
439 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
440 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
441 case UIMSG_80:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
442 __debugbreak();
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
443 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
444 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
445 pGUIWindow_CurrentMenu->Release();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
446 pCurrentScreen = SCREEN_OPTIONS;
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
447 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_8, 0, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
448 continue;
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
449 case UIMSG_ArrowUp:
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
450 --pSaveListPosition;
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
451 if ( pSaveListPosition < 0 )
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
452 pSaveListPosition = 0;
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
453 GUIWindow::Create(215, 199, 17, 17, WINDOW_PressedButton2, (int)pBtnArrowUp, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
454 continue;
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
455 case UIMSG_DownArrow:
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
456 ++pSaveListPosition;
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
457 if ( pSaveListPosition >= uMessageParam )
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
458 pSaveListPosition = uMessageParam - 1;
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
459 GUIWindow::Create(215, 323, 17, 17, WINDOW_PressedButton2, (int)pBtnDownArrow, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
460 continue;
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
461 case UIMSG_Cancel:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
462 GUIWindow::Create(350, 302, 106, 42, WINDOW_CloseRestWindowBtn, (int)pBtnCancel, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
463 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
464 case UIMSG_SaveLoadBtn:
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
465 GUIWindow::Create(241, 302, 106, 42, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
466 continue;
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
467 case UIMSG_SelectLoadSlot:
1038
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
468 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
469 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
470 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam )
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
471 {
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
472 v10 = pSaveListPosition + uMessageParam;
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
473 if ( dword_6BE138 == pSaveListPosition + uMessageParam )
0
Ritor1
parents:
diff changeset
474 {
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
475 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
476 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
0
Ritor1
parents:
diff changeset
477 }
Ritor1
parents:
diff changeset
478 uLoadGameUI_SelectedSlot = v10;
Ritor1
parents:
diff changeset
479 dword_6BE138 = v10;
Ritor1
parents:
diff changeset
480 }
Ritor1
parents:
diff changeset
481 else
Ritor1
parents:
diff changeset
482 {
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
483 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
43
196847ece26a autosave slot fix
zipi
parents: 42
diff changeset
484 if ( strcmp((const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pGlobalTXT_LocalizationStrings[72]) )// "Empty"
196847ece26a autosave slot fix
zipi
parents: 42
diff changeset
485 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, (const char *)&pSavegameHeader[uLoadGameUI_SelectedSlot]);
0
Ritor1
parents:
diff changeset
486 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
Ritor1
parents:
diff changeset
487 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
488 continue;
0
Ritor1
parents:
diff changeset
489 case UIMSG_LoadGame:
Ritor1
parents:
diff changeset
490 if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
Ritor1
parents:
diff changeset
491 {
Ritor1
parents:
diff changeset
492 LoadGame(uLoadGameUI_SelectedSlot);
1214
0d6c7ff3cddd simplified stru193_math constructor and class definition
Grumpy7
parents: 1207
diff changeset
493 uGameState = GAME_STATE_LOADING_GAME;
0
Ritor1
parents:
diff changeset
494 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
495 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
496 continue;
0
Ritor1
parents:
diff changeset
497 case UIMSG_SaveGame:
1038
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
498 if ( pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
499 {
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
500 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
837
bebc19f3d2af Save/load work with some problems
Gloval
parents: 821
diff changeset
501 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], (const char *)pKeyActionMap->pPressedKeysBuffer);
0
Ritor1
parents:
diff changeset
502 }
Ritor1
parents:
diff changeset
503 DoSavegame(uLoadGameUI_SelectedSlot);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
504 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
505 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
506 case UIMSG_Game_OpenSaveGameDialog:
0
Ritor1
parents:
diff changeset
507 pGUIWindow_CurrentMenu->Release();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
508 pCurrentScreen = SCREEN_SAVEGAME;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
509 SaveUI_Load();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
510 continue;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
511 case UIMSG_Game_OpenOptionsDialog://Open
0
Ritor1
parents:
diff changeset
512 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
513 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
514 pGUIWindow_CurrentMenu->Release();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
515 viewparams->field_48 = 1;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
516 pCurrentScreen = SCREEN_OPTIONS;
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
517
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
518 options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
519 options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
520 options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
521 options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
522 options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
523 options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
524 options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
525 options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
526 options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
527 options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
528 options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
529 options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
530 options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
531 options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
532 options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
533 options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
534 options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
535 options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
536 options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
537 options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE);
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
538
0
Ritor1
parents:
diff changeset
539 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Options, 0, 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
540 pGUIWindow_CurrentMenu->CreateButton(22, 270,
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
541 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
542 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight,
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
543 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
544 pGUIWindow_CurrentMenu->CreateButton(93, 270,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
545 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
546 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight,
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
547 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
548 pGUIWindow_CurrentMenu->CreateButton(164, 270,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
549 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
550 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight,
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
551 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
552
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
553 pGUIWindow_CurrentMenu->CreateButton(20, 303,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
554 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
555 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight,
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
556 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
557 pGUIWindow_CurrentMenu->CreateButton(128, 303,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
558 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
559 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight,
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
560 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
561 pGUIWindow_CurrentMenu->CreateButton(20, 325,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
562 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
563 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight,
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
564 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
565 pGUIWindow_CurrentMenu->CreateButton(128, 325,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
566 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth,
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
567 pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight,
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
568 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
569
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
570 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
571 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
572 pGUIWindow_CurrentMenu->CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
573
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
574 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
575 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
576 pGUIWindow_CurrentMenu->CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
577
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
578 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
579 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
580 pGUIWindow_CurrentMenu->CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
581
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
582 pGUIWindow_CurrentMenu->CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game"
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
583 pGUIWindow_CurrentMenu->CreateButton( 19, 140, 214, 40, 1, 0, UIMSG_OpenKeyMappingOptions, 0, 0x4Bu, "", 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
584 pGUIWindow_CurrentMenu->CreateButton( 19, 194, 214, 40, 1, 0, UIMSG_OpenVideoOptions, 0, 86, "", 0);
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
585 continue;
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
586
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
587 case UIMSG_OpenKeyMappingOptions://Open
0
Ritor1
parents:
diff changeset
588 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
589 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
590 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
591 viewparams->field_48 = 1;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
592 pCurrentScreen = SCREEN_KEYBOARD_OPTIONS;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
593 uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
594 uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
595 uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
596 uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
597 uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE);
0
Ritor1
parents:
diff changeset
598 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_KeyMappingOptions, 0, 0);
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
599 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
600 pGUIWindow_CurrentMenu->CreateButton(19u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage1, 0, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
601 pGUIWindow_CurrentMenu->CreateButton(127u, 0x12Eu, 0x6Cu, 0x14u, 1, 0, UIMSG_SelectKeyPage2, 0, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
602 pGUIWindow_CurrentMenu->CreateButton(127u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_ResetKeyMapping, 0, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
603 pGUIWindow_CurrentMenu->CreateButton(19u, 0x144u, 0x6Cu, 0x14u, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
604 pGUIWindow_CurrentMenu->CreateButton(129u, 0x94u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
605 pGUIWindow_CurrentMenu->CreateButton(129u, 0xA7u, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 1u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
606 pGUIWindow_CurrentMenu->CreateButton(129u, 0xBAu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 2u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
607 pGUIWindow_CurrentMenu->CreateButton(129u, 0xCDu, 0x46u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 3u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
608 pGUIWindow_CurrentMenu->CreateButton(129u, 224u, 70u, 19u, 1, 0, UIMSG_ChangeKeyButton, 4u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
609 pGUIWindow_CurrentMenu->CreateButton(129u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 5u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
610 pGUIWindow_CurrentMenu->CreateButton(129u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 6u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
611 pGUIWindow_CurrentMenu->CreateButton(350u, 148u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 7u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
612 pGUIWindow_CurrentMenu->CreateButton(350u, 167u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 8u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
613 pGUIWindow_CurrentMenu->CreateButton(350u, 186u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 9u, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
614 pGUIWindow_CurrentMenu->CreateButton(350u, 205u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xAu, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
615 pGUIWindow_CurrentMenu->CreateButton(350u, 224u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xBu, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
616 pGUIWindow_CurrentMenu->CreateButton(350u, 243u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xCu, 0, "", 0);
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
617 pGUIWindow_CurrentMenu->CreateButton(350u, 262u, 70u, 0x13u, 1, 0, UIMSG_ChangeKeyButton, 0xDu, 0, "", 0);
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
618 uGameMenuUI_CurentlySelectedKeyIdx = -1;
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
619 KeyboardPageNum = 1;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
620 memset(GameMenuUI_InvaligKeyBindingsFlags.data(), 0, sizeof(GameMenuUI_InvaligKeyBindingsFlags));
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
621 //*(_WORD *)KeyButtonArray[28] = 0;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
622 memcpy(pPrevVirtualCidesMapping.data(), pKeyActionMap->pVirtualKeyCodesMapping, 0x78u);
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
623 //v1 = "";
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
624 //v0 = 1;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
625 continue;
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
626 case UIMSG_ChangeKeyButton:
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
627 if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
628 {
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
629 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
630 continue;
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
631 }
0
Ritor1
parents:
diff changeset
632 v14 = uMessageParam;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
633 if ( KeyboardPageNum != 1 )
0
Ritor1
parents:
diff changeset
634 v14 = uMessageParam + 14;
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
635 uGameMenuUI_CurentlySelectedKeyIdx = v14;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
636 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
637 continue;
0
Ritor1
parents:
diff changeset
638 case UIMSG_ResetKeyMapping:
Ritor1
parents:
diff changeset
639 v197 = 1;
Ritor1
parents:
diff changeset
640 pKeyActionMap->SetDefaultMapping();
Ritor1
parents:
diff changeset
641 uAction = 0;
Ritor1
parents:
diff changeset
642 do
Ritor1
parents:
diff changeset
643 {
Ritor1
parents:
diff changeset
644 v15 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
Ritor1
parents:
diff changeset
645 if ( v15 != pPrevVirtualCidesMapping[uAction] )
Ritor1
parents:
diff changeset
646 {
Ritor1
parents:
diff changeset
647 if ( v197 )
Ritor1
parents:
diff changeset
648 {
Ritor1
parents:
diff changeset
649 v16 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
650 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v16, 1);
0
Ritor1
parents:
diff changeset
651 v197 = 0;
Ritor1
parents:
diff changeset
652 }
Ritor1
parents:
diff changeset
653 else
Ritor1
parents:
diff changeset
654 {
Ritor1
parents:
diff changeset
655 v17 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
Ritor1
parents:
diff changeset
656 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[uAction]), v17, 0);
Ritor1
parents:
diff changeset
657 }
Ritor1
parents:
diff changeset
658 }
Ritor1
parents:
diff changeset
659 pPrevVirtualCidesMapping[uAction] = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
Ritor1
parents:
diff changeset
660 v18 = uAction++;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
661 v13 = uAction > 28;
0
Ritor1
parents:
diff changeset
662 v12 = uAction - 28 < 0;
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
663 GameMenuUI_InvaligKeyBindingsFlags[v18] = 0;
0
Ritor1
parents:
diff changeset
664 }
Ritor1
parents:
diff changeset
665 while ( v12 ^ v13 );
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
666 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
667 continue;
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
668 case UIMSG_SelectKeyPage1:
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
669 KeyboardPageNum = 1;
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
670 continue;
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
671 case UIMSG_SelectKeyPage2:
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
672 KeyboardPageNum = 2;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
673 continue;
0
Ritor1
parents:
diff changeset
674 case UIMSG_OpenVideoOptions:
Ritor1
parents:
diff changeset
675 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
676 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
677 pGUIWindow_CurrentMenu->Release();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
678 viewparams->field_48 = 1;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
679 pCurrentScreen = SCREEN_VIDEO_OPTIONS;
0
Ritor1
parents:
diff changeset
680 uTextureID_507C10 = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
681 uTextureID_507C14 = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
682 uTextureID_507C18 = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
683 uTextureID_507C1C = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
684 uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
685 uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
686 pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
687 pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
688 pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
689 pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
690 pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
691 pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
692 pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
693 pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
694 pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
695 pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
696 uTextureID_507C50 = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
697 uTextureID_507C54 = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
698 uTextureID_507C58 = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE);
Ritor1
parents:
diff changeset
699 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_VideoOptions, 0, 0);
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
700 pGUIWindow_CurrentMenu->CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0);
0
Ritor1
parents:
diff changeset
701 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
702 {
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
703 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x118u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleBloodsplats, 0, 0, "", 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
704 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
705 pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0);
0
Ritor1
parents:
diff changeset
706 }
Ritor1
parents:
diff changeset
707 if ( !pRenderer->bWindowMode )
Ritor1
parents:
diff changeset
708 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
709 //v0 = 1;
0
Ritor1
parents:
diff changeset
710 if ( GammaController::IsGammaSupported() )
Ritor1
parents:
diff changeset
711 {
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
712 pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
713 pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
714 pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0);
0
Ritor1
parents:
diff changeset
715 }
Ritor1
parents:
diff changeset
716 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
717 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
718 case UIMSG_1A9:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
719 __debugbreak();
0
Ritor1
parents:
diff changeset
720 if ( uMessageParam == 4 )
Ritor1
parents:
diff changeset
721 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
722 //--uGammaPos;
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
723 if ( (uGammaPos -- -1) < 0 )
0
Ritor1
parents:
diff changeset
724 {
Ritor1
parents:
diff changeset
725 uGammaPos = 0;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
726 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
727 continue;
0
Ritor1
parents:
diff changeset
728 }
Ritor1
parents:
diff changeset
729 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
Ritor1
parents:
diff changeset
730 pGame->pGammaController->Initialize(v19);
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
731 GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
732 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
733 continue;
0
Ritor1
parents:
diff changeset
734 }
Ritor1
parents:
diff changeset
735 if ( uMessageParam == 5 )
Ritor1
parents:
diff changeset
736 {
Ritor1
parents:
diff changeset
737 ++uGammaPos;
Ritor1
parents:
diff changeset
738 if ( (signed int)uGammaPos <= 9 )
Ritor1
parents:
diff changeset
739 {
Ritor1
parents:
diff changeset
740 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
Ritor1
parents:
diff changeset
741 pGame->pGammaController->Initialize(v21);
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
742 GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
743 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
744 continue;
0
Ritor1
parents:
diff changeset
745 }
Ritor1
parents:
diff changeset
746 uGammaPos = 9;
Ritor1
parents:
diff changeset
747 }
Ritor1
parents:
diff changeset
748 else
Ritor1
parents:
diff changeset
749 {
Ritor1
parents:
diff changeset
750 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17;
Ritor1
parents:
diff changeset
751 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
Ritor1
parents:
diff changeset
752 pGame->pGammaController->Initialize(v22);
Ritor1
parents:
diff changeset
753 }
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
754 pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
755 continue;
0
Ritor1
parents:
diff changeset
756 case UIMSG_ToggleBloodsplats:
Ritor1
parents:
diff changeset
757 pGame->ToggleFlags2(0x20u);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
758 continue;
0
Ritor1
parents:
diff changeset
759 case UIMSG_ToggleColoredLights:
Ritor1
parents:
diff changeset
760 pRenderer->bUseColoredLights = pRenderer->bUseColoredLights == 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
761 continue;
0
Ritor1
parents:
diff changeset
762 case UIMSG_ToggleTint:
Ritor1
parents:
diff changeset
763 pRenderer->bTinting = pRenderer->bTinting == 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
764 continue;
0
Ritor1
parents:
diff changeset
765 case UIMSG_ChangeMusicVolume:
Ritor1
parents:
diff changeset
766 if ( uMessageParam == 4 )
Ritor1
parents:
diff changeset
767 {
Ritor1
parents:
diff changeset
768 --uMusicVolimeMultiplier;
Ritor1
parents:
diff changeset
769 if ( (char)uMusicVolimeMultiplier < 1 )
Ritor1
parents:
diff changeset
770 uMusicVolimeMultiplier = 0;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
771 GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
772 if ( uMusicVolimeMultiplier )
328
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
773 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
774 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
775 continue;
0
Ritor1
parents:
diff changeset
776 }
Ritor1
parents:
diff changeset
777 if ( uMessageParam == 5 )
Ritor1
parents:
diff changeset
778 {
Ritor1
parents:
diff changeset
779 ++uMusicVolimeMultiplier;
Ritor1
parents:
diff changeset
780 if ( (char)uMusicVolimeMultiplier > 9 )
Ritor1
parents:
diff changeset
781 uMusicVolimeMultiplier = 9;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
782 GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
783 if ( uMusicVolimeMultiplier )
328
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
784 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0);
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
785 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
786 continue;
0
Ritor1
parents:
diff changeset
787 }
Ritor1
parents:
diff changeset
788 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;
Ritor1
parents:
diff changeset
789 if ( (char)uMusicVolimeMultiplier > 9 )
Ritor1
parents:
diff changeset
790 uMusicVolimeMultiplier = 9;
Ritor1
parents:
diff changeset
791 if ( uMusicVolimeMultiplier )
328
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
792 pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
793 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
794 continue;
0
Ritor1
parents:
diff changeset
795 case UIMSG_ChangeSoundVolume:
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
796 if ( uMessageParam == 4 )//reduce sound level button left
0
Ritor1
parents:
diff changeset
797 {
Ritor1
parents:
diff changeset
798 --uSoundVolumeMultiplier;
Ritor1
parents:
diff changeset
799 if ( (char)uSoundVolumeMultiplier < 1 )
Ritor1
parents:
diff changeset
800 uSoundVolumeMultiplier = 0;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
801 GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
328
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
802 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
803 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
804 continue;
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
805 }
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
806 if ( uMessageParam == 5 )//Increase sound level button right
0
Ritor1
parents:
diff changeset
807 {
Ritor1
parents:
diff changeset
808 ++uSoundVolumeMultiplier;
Ritor1
parents:
diff changeset
809 if ( (char)uSoundVolumeMultiplier > 8 )
Ritor1
parents:
diff changeset
810 uSoundVolumeMultiplier = 9;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
811 //v168 = 1;
0
Ritor1
parents:
diff changeset
812 v24 = 435;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
813 //v154 = (int)pBtn_SliderRight;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
814 GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
328
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
815 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
816 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
817 continue;
0
Ritor1
parents:
diff changeset
818 }
Ritor1
parents:
diff changeset
819 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
Ritor1
parents:
diff changeset
820 if ( (char)uSoundVolumeMultiplier > 8 )
Ritor1
parents:
diff changeset
821 uSoundVolumeMultiplier = 9;
328
8e23edf57e27 little fix
Ritor1
parents: 322
diff changeset
822 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
823 pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
824 continue;
0
Ritor1
parents:
diff changeset
825 case UIMSG_ToggleFlipOnExit:
Ritor1
parents:
diff changeset
826 bFlipOnExit = bFlipOnExit == 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
827 continue;
0
Ritor1
parents:
diff changeset
828 case UIMSG_ToggleAlwaysRun:
Ritor1
parents:
diff changeset
829 bAlwaysRun = bAlwaysRun == 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
830 continue;
0
Ritor1
parents:
diff changeset
831 case UIMSG_ToggleWalkSound:
Ritor1
parents:
diff changeset
832 bWalkSound = bWalkSound == 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
833 continue;
0
Ritor1
parents:
diff changeset
834 case UIMSG_ToggleShowDamage:
Ritor1
parents:
diff changeset
835 bShowDamage = bShowDamage == 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
836 continue;
0
Ritor1
parents:
diff changeset
837 case UIMSG_ChangeVoiceVolume:
Ritor1
parents:
diff changeset
838 if ( uMessageParam == 4 )
Ritor1
parents:
diff changeset
839 {
Ritor1
parents:
diff changeset
840 --uVoicesVolumeMultiplier;
Ritor1
parents:
diff changeset
841 if ( (char)uVoicesVolumeMultiplier < 1 )
Ritor1
parents:
diff changeset
842 uVoicesVolumeMultiplier = 0;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
843 GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
844 if ( !uVoicesVolumeMultiplier )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
845 continue;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
846 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
847 continue;
0
Ritor1
parents:
diff changeset
848 }
Ritor1
parents:
diff changeset
849 if ( uMessageParam == 5 )
Ritor1
parents:
diff changeset
850 {
Ritor1
parents:
diff changeset
851 ++uVoicesVolumeMultiplier;
Ritor1
parents:
diff changeset
852 if ( (char)uVoicesVolumeMultiplier > 8 )
Ritor1
parents:
diff changeset
853 uVoicesVolumeMultiplier = 9;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
854 GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
855 if ( !uVoicesVolumeMultiplier )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
856 continue;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
857 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
858 continue;
0
Ritor1
parents:
diff changeset
859 }
Ritor1
parents:
diff changeset
860 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
Ritor1
parents:
diff changeset
861 if ( (char)uVoicesVolumeMultiplier > 8 )
Ritor1
parents:
diff changeset
862 uVoicesVolumeMultiplier = 9;
Ritor1
parents:
diff changeset
863 if ( !uVoicesVolumeMultiplier )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
864 continue;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
865 pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
866 continue;
0
Ritor1
parents:
diff changeset
867 case UIMSG_SetTurnSpeed:
Ritor1
parents:
diff changeset
868 if ( uMessageParam )
Ritor1
parents:
diff changeset
869 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam;
Ritor1
parents:
diff changeset
870 uTurnSpeed = uMessageParam;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
871 continue;
0
Ritor1
parents:
diff changeset
872 case UIMSG_SetGraphicsMode:
Ritor1
parents:
diff changeset
873 if ( !bUseLoResSprites )
Ritor1
parents:
diff changeset
874 {
Ritor1
parents:
diff changeset
875 byte_6BE388_graphicsmode = uMessageParam;
Ritor1
parents:
diff changeset
876 MM7Initialization();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
877 continue;
0
Ritor1
parents:
diff changeset
878 }
Ritor1
parents:
diff changeset
879 if ( uMessageParam )
Ritor1
parents:
diff changeset
880 {
Ritor1
parents:
diff changeset
881 if ( uMessageParam == 1 )
Ritor1
parents:
diff changeset
882 {
Ritor1
parents:
diff changeset
883 byte_6BE388_graphicsmode = 0;
Ritor1
parents:
diff changeset
884 }
Ritor1
parents:
diff changeset
885 else
Ritor1
parents:
diff changeset
886 {
Ritor1
parents:
diff changeset
887 if ( uMessageParam != 2 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
888 continue;
0
Ritor1
parents:
diff changeset
889 byte_6BE388_graphicsmode = 1;
Ritor1
parents:
diff changeset
890 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
891 MM7Initialization();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
892 continue;
0
Ritor1
parents:
diff changeset
893 }
Ritor1
parents:
diff changeset
894 ModalWindow(pNPCTopics[453].pText, 0);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
895 continue;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
896 case UIMSG_GameMenu_ReturnToGame:
0
Ritor1
parents:
diff changeset
897 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
898 pEventTimer->Resume();
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
899 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
900 viewparams->bRedrawGameUI = 1;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
901 stru_506E40.Release();
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
902 continue;
0
Ritor1
parents:
diff changeset
903 case UIMSG_OpenQuestBook:
Ritor1
parents:
diff changeset
904 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
905 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
906 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
907 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
908 pEventTimer->Pause();
Ritor1
parents:
diff changeset
909 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
910 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
911 pBooksWindow = GUIWindow::Create(493u, 355u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Quests, 0);
0
Ritor1
parents:
diff changeset
912 bFlashQuestBook = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
913 continue;
0
Ritor1
parents:
diff changeset
914 case UIMSG_OpenAutonotes:
Ritor1
parents:
diff changeset
915 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
916 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
917 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
918 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
919 pEventTimer->Pause();
Ritor1
parents:
diff changeset
920 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
921 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Book, uMessage, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
922 pBooksWindow = GUIWindow::Create(527u, 353u, 0, 0, WINDOW_BooksWindow, (int)pBtn_Autonotes, 0);
0
Ritor1
parents:
diff changeset
923 bFlashAutonotesBook = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
924 continue;
0
Ritor1
parents:
diff changeset
925 case UIMSG_OpenMapBook:
Ritor1
parents:
diff changeset
926 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
927 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
928 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
929 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
930 pEventTimer->Pause();
693
e0a1fccc89b1 map render fixes
Gloval
parents: 690
diff changeset
931 viewparams->sViewCenterX = pParty->vPosition.x;
e0a1fccc89b1 map render fixes
Gloval
parents: 690
diff changeset
932 viewparams->sViewCenterY = pParty->vPosition.y;
0
Ritor1
parents:
diff changeset
933 pAudioPlayer->StopChannels(-1, -1);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
934 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
935 pBooksWindow = GUIWindow::Create(546, 353, 0, 0, WINDOW_BooksWindow, (int)pBtn_Maps, 0);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
936 continue;
0
Ritor1
parents:
diff changeset
937 case UIMSG_OpenCalendar:
Ritor1
parents:
diff changeset
938 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
939 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
940 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
941 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
942 pEventTimer->Pause();
Ritor1
parents:
diff changeset
943 pAudioPlayer->StopChannels(-1, -1);
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
944 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
945 pBooksWindow = GUIWindow::Create(570, 354, 0, 0, WINDOW_BooksWindow, (int)pBtn_Calendar, 0);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
946 continue;
0
Ritor1
parents:
diff changeset
947 case UIMSG_OpenHistoryBook:
Ritor1
parents:
diff changeset
948 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
949 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
950 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
951 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
952 pEventTimer->Pause();
Ritor1
parents:
diff changeset
953 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
954 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, uMessage, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
955 pBooksWindow = GUIWindow::Create(0x258u, 0x169u, 0, 0, WINDOW_BooksWindow, (int)pBtn_History, 0);
0
Ritor1
parents:
diff changeset
956 bFlashHistoryBook = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
957 continue;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
958 case UIMSG_Escape:// íàæàòèå Escape and return to game
0
Ritor1
parents:
diff changeset
959 back_to_game();
Ritor1
parents:
diff changeset
960 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
961 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
962 switch ( pCurrentScreen )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
963 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
964 case SCREEN_E:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
965 __debugbreak();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
966 case SCREEN_NPC_DIALOGUE:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
967 case SCREEN_CHEST:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
968 case SCREEN_CHEST_INVENTORY:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
969 case SCREEN_CHANGE_LOCATION:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
970 case SCREEN_INPUT_BLV:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
971 case SCREEN_QUICK_REFERENCE:
0
Ritor1
parents:
diff changeset
972 if ( dword_50CDC8 )
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
973 break;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
974 CloseWindowBackground();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
975 uMessageParam = 1;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
976 break;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
977 case SCREEN_HOUSE:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
978 if ( !dword_50CDC8 && !dword_5C35C8 )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
979 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
980 CloseWindowBackground();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
981 dword_5C35C8 = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
982 uMessageParam = 1;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
983 break;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
984 }
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
985 break;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
986 }
0
Ritor1
parents:
diff changeset
987 if ( !ptr_507BDC )
Ritor1
parents:
diff changeset
988 {
Ritor1
parents:
diff changeset
989 pRenderer->ClearZBuffer(0, 479);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
990 viewparams->bRedrawGameUI = 1;
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
991 viewparams->field_48 = 1;
0
Ritor1
parents:
diff changeset
992 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
993 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
994 if ( pCurrentScreen > SCREEN_67 )
0
Ritor1
parents:
diff changeset
995 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
996 if ( pCurrentScreen == SCREEN_QUICK_REFERENCE )
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
997 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
998 pIcons_LOD->_4114F2();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
999 if ( pGUIWindow_Settings )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1000 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1001 if ( pCurrentScreen == SCREEN_CHARACTERS )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1002 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1003 pMouse->SetCursorBitmap("MICON2");
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1004 }
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1005 else
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1006 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1007 pGUIWindow_Settings->Release();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1008 pGUIWindow_Settings = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1009 pMouse->SetCursorBitmap("MICON1");
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1010 GameUI_Footer_TimeLeft = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1011 unk_50C9A0 = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1012 back_to_game();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1013 }
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1014 }
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1015 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1016 uActiveCharacter = pParty->GetNextActiveCharacter();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1017 pGUIWindow_CurrentMenu->Release();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1018 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1019 window_SpeakInHouse = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1020 pGUIWindow_CurrentMenu = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1021 pEventTimer->Resume();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1022 pCurrentScreen = SCREEN_GAME;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1023 viewparams->bRedrawGameUI = 1;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1024 pIcons_LOD->_4355F7();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1025 continue;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1026 }
0
Ritor1
parents:
diff changeset
1027 }
Ritor1
parents:
diff changeset
1028 else
Ritor1
parents:
diff changeset
1029 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1030 if ( pCurrentScreen < SCREEN_64 )
0
Ritor1
parents:
diff changeset
1031 {
Ritor1
parents:
diff changeset
1032 switch ( pCurrentScreen )
Ritor1
parents:
diff changeset
1033 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1034 case SCREEN_CASTING:
0
Ritor1
parents:
diff changeset
1035 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
1036 if ( some_active_character )
Ritor1
parents:
diff changeset
1037 {
Ritor1
parents:
diff changeset
1038 uActiveCharacter = some_active_character;
Ritor1
parents:
diff changeset
1039 uActiveCharacter = pParty->GetNextActiveCharacter();
Ritor1
parents:
diff changeset
1040 some_active_character = 0;
Ritor1
parents:
diff changeset
1041 if ( pParty->bTurnBasedModeOn )
Ritor1
parents:
diff changeset
1042 pTurnEngine->_40471C();
Ritor1
parents:
diff changeset
1043 dword_50C9D0 = 0;
Ritor1
parents:
diff changeset
1044 dword_50C9D4 = 0;
Ritor1
parents:
diff changeset
1045 dword_50C9D8 = 0;
Ritor1
parents:
diff changeset
1046 }
Ritor1
parents:
diff changeset
1047 if ( ptr_50C9A4 && ptr_50C9A4->uItemID )
Ritor1
parents:
diff changeset
1048 {
Ritor1
parents:
diff changeset
1049 LOBYTE(ptr_50C9A4->uAttributes) &= 0xFu;
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 983
diff changeset
1050 _50C9A8_item_enchantment_timer = 0;
0
Ritor1
parents:
diff changeset
1051 ptr_50C9A4 = 0;
Ritor1
parents:
diff changeset
1052 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1053 if ( pGUIWindow_Settings )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1054 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1055 if ( pCurrentScreen == SCREEN_CHARACTERS )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1056 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1057 pMouse->SetCursorBitmap("MICON2");
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1058 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1059 else
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1060 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1061 pGUIWindow_Settings->Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1062 pGUIWindow_Settings = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1063 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1064 GameUI_Footer_TimeLeft = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1065 unk_50C9A0 = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1066 back_to_game();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1067 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1068 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1069 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1070 uActiveCharacter = pParty->GetNextActiveCharacter();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1071 pGUIWindow_CurrentMenu->Release();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1072 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1073 window_SpeakInHouse = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1074 pGUIWindow_CurrentMenu = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1075 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1076 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1077 viewparams->bRedrawGameUI = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1078 pIcons_LOD->_4355F7();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1079 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1080 case SCREEN_BOOKS:
0
Ritor1
parents:
diff changeset
1081 pBooksWindow->Release();
Ritor1
parents:
diff changeset
1082 //crt_deconstruct_ptr_6A0118();
Ritor1
parents:
diff changeset
1083 pBooksWindow = 0;
Ritor1
parents:
diff changeset
1084 pEventTimer->Resume();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1085 if ( pGUIWindow_Settings )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1086 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1087 if ( pCurrentScreen == SCREEN_CHARACTERS )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1088 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1089 pMouse->SetCursorBitmap("MICON2");
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1090 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1091 else
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1092 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1093 pGUIWindow_Settings->Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1094 pGUIWindow_Settings = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1095 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1096 GameUI_Footer_TimeLeft = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1097 unk_50C9A0 = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1098 back_to_game();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1099 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1100 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1101 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1102 uActiveCharacter = pParty->GetNextActiveCharacter();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1103 pGUIWindow_CurrentMenu->Release();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1104 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1105 window_SpeakInHouse = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1106 pGUIWindow_CurrentMenu = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1107 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1108 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1109 viewparams->bRedrawGameUI = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1110 pIcons_LOD->_4355F7();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1111 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1112 case SCREEN_SAVEGAME:
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1113 case SCREEN_LOADGAME:
0
Ritor1
parents:
diff changeset
1114 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
1115 //crt_deconstruct_ptr_6A0118();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1116 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1117 break;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1118 case SCREEN_CHEST_INVENTORY:
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1119 pCurrentScreen = SCREEN_CHEST;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1120 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1121 case SCREEN_CHEST:
0
Ritor1
parents:
diff changeset
1122 pWindow2 = pChestWindow;
Ritor1
parents:
diff changeset
1123 pWindow2->Release();
Ritor1
parents:
diff changeset
1124 pIcons_LOD->_4114F2();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1125 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1126 viewparams->bRedrawGameUI = 1;
0
Ritor1
parents:
diff changeset
1127 pEventTimer->Resume();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1128 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1129 case SCREEN_19:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1130 __debugbreak();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1131 pWindow2 = ptr_507BC8;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1132 pWindow2->Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1133 pIcons_LOD->_4114F2();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1134 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1135 viewparams->bRedrawGameUI = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1136 pEventTimer->Resume();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1137 continue;
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
1138 case SCREEN_OPTIONS://Close
948
5a2dbb00c399 Code cleaning.
Nomad
parents: 938
diff changeset
1139 options_menu_skin.Relaease();
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
1140 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
1141 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
Ritor1
parents:
diff changeset
1142 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
Ritor1
parents:
diff changeset
1143 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier);
Ritor1
parents:
diff changeset
1144 WriteWindowsRegistryInt("WalkSound", bWalkSound);
Ritor1
parents:
diff changeset
1145 WriteWindowsRegistryInt("ShowDamage", bShowDamage);
Ritor1
parents:
diff changeset
1146 WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode);
Ritor1
parents:
diff changeset
1147 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
Ritor1
parents:
diff changeset
1148 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
Ritor1
parents:
diff changeset
1149 if ( !uTurnSpeed )
Ritor1
parents:
diff changeset
1150 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1151 WriteWindowsRegistryInt("TurnDelta", 3);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1152 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1153 break;
0
Ritor1
parents:
diff changeset
1154 }
Ritor1
parents:
diff changeset
1155 if ( uTurnSpeed == 64 )
Ritor1
parents:
diff changeset
1156 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1157 WriteWindowsRegistryInt("TurnDelta", 2);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1158 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1159 break;
0
Ritor1
parents:
diff changeset
1160 }
Ritor1
parents:
diff changeset
1161 if ( uTurnSpeed != 128 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1162 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1163 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1164 break;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1165 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1166 WriteWindowsRegistryInt("TurnDelta", 1);
0
Ritor1
parents:
diff changeset
1167 stru_506E40.Release();
Ritor1
parents:
diff changeset
1168 break;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1169 case SCREEN_MENU:
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
1170 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
1171 pIcons_LOD->_4114F2();
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
1172 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
1173 pIcons_LOD->_4114F2();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1174 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1175 break;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1176 case SCREEN_VIDEO_OPTIONS:
0
Ritor1
parents:
diff changeset
1177 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
1178 {
Ritor1
parents:
diff changeset
1179 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
Ritor1
parents:
diff changeset
1180 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
Ritor1
parents:
diff changeset
1181 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pGame->uFlags2) >> 5) & 1);
Ritor1
parents:
diff changeset
1182 }
Ritor1
parents:
diff changeset
1183 if ( pRenderer->bWindowMode )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1184 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1185 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1186 break;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1187 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1188 //v30 = uGammaPos;
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1189 //v31 = "GammaPos";
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1190 WriteWindowsRegistryInt("GammaPos", uGammaPos);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1191 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1192 break;
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
1193
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
1194 case SCREEN_KEYBOARD_OPTIONS://Return to game
0
Ritor1
parents:
diff changeset
1195 v197 = 1;
Ritor1
parents:
diff changeset
1196 v32 = 0;
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
1197 while ( !GameMenuUI_InvaligKeyBindingsFlags[v32])
0
Ritor1
parents:
diff changeset
1198 {
Ritor1
parents:
diff changeset
1199 ++v32;
Ritor1
parents:
diff changeset
1200 if ( v32 >= 28 )
Ritor1
parents:
diff changeset
1201 {
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1202 thisb = (signed int)&uTextureID_Optkb;
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
1203 assert(false && "Invalid condition values");
0
Ritor1
parents:
diff changeset
1204 do
Ritor1
parents:
diff changeset
1205 {
Ritor1
parents:
diff changeset
1206 if ( *(int *)thisb )
Ritor1
parents:
diff changeset
1207 pIcons_LOD->pTextures[*(int *)thisb].Release();
Ritor1
parents:
diff changeset
1208 thisb += 4;
Ritor1
parents:
diff changeset
1209 }
1031
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
1210 while ( thisb < (signed int)0x00507C08 );
f93d17337113 UI stuff.
Nomad
parents: 1029
diff changeset
1211
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1212 memset(&uTextureID_Optkb, 0, 0x14u);
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
1213 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
1214 uAction = 0;
Ritor1
parents:
diff changeset
1215 do
Ritor1
parents:
diff changeset
1216 {
Ritor1
parents:
diff changeset
1217 v33 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
Ritor1
parents:
diff changeset
1218 if ( v33 != pPrevVirtualCidesMapping[uAction] )
Ritor1
parents:
diff changeset
1219 {
Ritor1
parents:
diff changeset
1220 if ( v197 )
Ritor1
parents:
diff changeset
1221 {
Ritor1
parents:
diff changeset
1222 v34 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1223 GUI_ReplaceHotkey(v34, LOBYTE(pPrevVirtualCidesMapping[uAction]), 1);
0
Ritor1
parents:
diff changeset
1224 v197 = 0;
Ritor1
parents:
diff changeset
1225 }
Ritor1
parents:
diff changeset
1226 else
Ritor1
parents:
diff changeset
1227 {
Ritor1
parents:
diff changeset
1228 v35 = pKeyActionMap->GetActionVKey((enum InputAction)uAction);
Ritor1
parents:
diff changeset
1229 GUI_ReplaceHotkey(v35, LOBYTE(pPrevVirtualCidesMapping[uAction]), 0);
Ritor1
parents:
diff changeset
1230 }
Ritor1
parents:
diff changeset
1231 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1232 if ( uAction && uAction != 2 && uAction != 3 && uAction != 1 && uAction != 25 && uAction != 26 )
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1233 pKeyToggleType = (KeyToggleType)1;
0
Ritor1
parents:
diff changeset
1234 else
Ritor1
parents:
diff changeset
1235 pKeyToggleType = (KeyToggleType)0;
Ritor1
parents:
diff changeset
1236 pKeyActionMap->SetKeyMapping(uAction, pPrevVirtualCidesMapping[uAction], pKeyToggleType);
Ritor1
parents:
diff changeset
1237 ++uAction;
Ritor1
parents:
diff changeset
1238 }
Ritor1
parents:
diff changeset
1239 while ( uAction < 28 );
Ritor1
parents:
diff changeset
1240 pKeyActionMap->StoreMappings();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1241 stru_506E40.Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1242 break;
0
Ritor1
parents:
diff changeset
1243 }
Ritor1
parents:
diff changeset
1244 }
369
6e984a4a896f GameMenu fix
Ritor1
parents: 365
diff changeset
1245 break;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
1246 case SCREEN_REST://close rest screen
0
Ritor1
parents:
diff changeset
1247 if ( dword_506F14 )
Ritor1
parents:
diff changeset
1248 {
Ritor1
parents:
diff changeset
1249 Rest(_506F18_num_hours_to_sleep);
Ritor1
parents:
diff changeset
1250 pParty->pPlayers[3].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
1251 pParty->pPlayers[2].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
1252 pParty->pPlayers[1].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
1253 pParty->pPlayers[0].pConditions[2] = 0i64;
Ritor1
parents:
diff changeset
1254 }
Ritor1
parents:
diff changeset
1255 pTexture_RestUI_CurrentSkyFrame->Release();
Ritor1
parents:
diff changeset
1256 pTexture_RestUI_CurrentHourglassFrame->Release();
Ritor1
parents:
diff changeset
1257 pTexture_RestUI_CurrentHourglassFrame = 0;
Ritor1
parents:
diff changeset
1258 pTexture_RestUI_CurrentSkyFrame = 0;
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
1259 pIcons_LOD->SyncLoadedFilesCount();
0
Ritor1
parents:
diff changeset
1260 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
1261 _506F18_num_hours_to_sleep = 0;
Ritor1
parents:
diff changeset
1262 dword_506F14 = 0;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1263 dword_507B94 = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1264 if ( pGUIWindow_Settings )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1265 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1266 if ( pCurrentScreen == SCREEN_CHARACTERS )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1267 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1268 pMouse->SetCursorBitmap("MICON2");
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1269 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1270 else
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1271 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1272 pGUIWindow_Settings->Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1273 pGUIWindow_Settings = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1274 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1275 GameUI_Footer_TimeLeft = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1276 unk_50C9A0 = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1277 back_to_game();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1278 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1279 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1280 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1281 uActiveCharacter = pParty->GetNextActiveCharacter();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1282 pGUIWindow_CurrentMenu->Release();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1283 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1284 window_SpeakInHouse = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1285 pGUIWindow_CurrentMenu = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1286 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1287 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1288 viewparams->bRedrawGameUI = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1289 pIcons_LOD->_4355F7();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1290 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1291 case SCREEN_E:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1292 __debugbreak();
0
Ritor1
parents:
diff changeset
1293 pGUIWindow_CurrentMenu->Release();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1294 pCurrentScreen = SCREEN_HOUSE;
0
Ritor1
parents:
diff changeset
1295 pIcons_LOD->_4114F2();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1296 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1297 case SCREEN_HOUSE:
0
Ritor1
parents:
diff changeset
1298 if ( uDialogueType )
Ritor1
parents:
diff changeset
1299 uDialogueType = 0;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1300 if ( uGameState == GAME_STATE_2 )
0
Ritor1
parents:
diff changeset
1301 {
Ritor1
parents:
diff changeset
1302 while ( sub_4BD8B5() )
Ritor1
parents:
diff changeset
1303 ;
Ritor1
parents:
diff changeset
1304 }
Ritor1
parents:
diff changeset
1305 else
Ritor1
parents:
diff changeset
1306 {
Ritor1
parents:
diff changeset
1307 if ( sub_4BD8B5() )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1308 continue;
0
Ritor1
parents:
diff changeset
1309 }
Ritor1
parents:
diff changeset
1310 sub_4B1D27();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1311 pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0);
0
Ritor1
parents:
diff changeset
1312 pVideoPlayer->Unload();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1313 pGUIWindow_CurrentMenu = window_SpeakInHouse;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1314 if ( pGUIWindow_Settings )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1315 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1316 if ( pCurrentScreen == SCREEN_CHARACTERS )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1317 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1318 pMouse->SetCursorBitmap("MICON2");
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1319 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1320 else
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1321 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1322 pGUIWindow_Settings->Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1323 pGUIWindow_Settings = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1324 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1325 GameUI_Footer_TimeLeft = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1326 unk_50C9A0 = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1327 back_to_game();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1328 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1329 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1330 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1331 uActiveCharacter = pParty->GetNextActiveCharacter();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1332 pGUIWindow_CurrentMenu->Release();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1333 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1334 window_SpeakInHouse = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1335 pGUIWindow_CurrentMenu = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1336 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1337 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1338 viewparams->bRedrawGameUI = true;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1339 pIcons_LOD->_4355F7();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1340 continue;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1341 case SCREEN_INPUT_BLV://click escape
0
Ritor1
parents:
diff changeset
1342 if ( uCurrentHouse_Animation == 153 )
735
6daaa2f18d0d Fixed some house sounds & shop-related stuff
Nomad
parents: 731
diff changeset
1343 PlayHouseSound(0x99u, HouseSound_Greeting_2);
0
Ritor1
parents:
diff changeset
1344 pVideoPlayer->Unload();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1345 if ( dword_5B65CC )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1346 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1347 pParty->field_709 = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1348 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1349 pParty->CountHirelings();
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1350 viewparams->bRedrawGameUI = true;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1351 dword_5B65CC = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1352 }
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1353 DialogueEnding();
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1354 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1355 viewparams->bRedrawGameUI = true;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1356 continue;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1357 case SCREEN_NPC_DIALOGUE://click escape
0
Ritor1
parents:
diff changeset
1358 if ( dword_5B65CC )
Ritor1
parents:
diff changeset
1359 {
Ritor1
parents:
diff changeset
1360 pParty->field_709 = 0;
Ritor1
parents:
diff changeset
1361 LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1362 pParty->CountHirelings();
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1363 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
1364 dword_5B65CC = 0;
Ritor1
parents:
diff changeset
1365 }
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1366 //goto LABEL_317;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1367 DialogueEnding();
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1368 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1369 viewparams->bRedrawGameUI = true;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1370 continue;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1371 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1372 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
0
Ritor1
parents:
diff changeset
1373 sub_4452BB();
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1374 DialogueEnding();
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1375 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1376 viewparams->bRedrawGameUI = true;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1377 continue;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1378 case SCREEN_CHANGE_LOCATION://click escape
0
Ritor1
parents:
diff changeset
1379 if ( pParty->vPosition.x < -22528 )
Ritor1
parents:
diff changeset
1380 pParty->vPosition.x = -22528;
Ritor1
parents:
diff changeset
1381 if ( pParty->vPosition.x > 22528 )
Ritor1
parents:
diff changeset
1382 pParty->vPosition.x = 22528;
Ritor1
parents:
diff changeset
1383 if ( pParty->vPosition.y < -22528 )
Ritor1
parents:
diff changeset
1384 pParty->vPosition.y = -22528;
Ritor1
parents:
diff changeset
1385 if ( pParty->vPosition.y > 22528 )
Ritor1
parents:
diff changeset
1386 pParty->vPosition.y = 22528;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1387 DialogueEnding();
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1388 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1389 viewparams->bRedrawGameUI = true;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1390 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1391 case SCREEN_VIDEO:
0
Ritor1
parents:
diff changeset
1392 pVideoPlayer->Unload();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1393 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1394 case SCREEN_CHARACTERS:
992
Nomad
parents: 991 990
diff changeset
1395 CharacterUI_ReleaseButtons();
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1396 sub_419379();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1397 pIcons_LOD->_4114F2();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1398 if ( pGUIWindow_Settings )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1399 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1400 if ( pCurrentScreen == SCREEN_CHARACTERS )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1401 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1402 pMouse->SetCursorBitmap("MICON2");
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1403 }
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1404 else
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1405 {
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1406 pGUIWindow_Settings->Release();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1407 pGUIWindow_Settings = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1408 pMouse->SetCursorBitmap("MICON1");
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1409 GameUI_Footer_TimeLeft = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1410 unk_50C9A0 = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1411 back_to_game();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1412 }
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1413 }
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1414 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1415 uActiveCharacter = pParty->GetNextActiveCharacter();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1416 pGUIWindow_CurrentMenu->Release();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1417 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1418 window_SpeakInHouse = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1419 pGUIWindow_CurrentMenu = 0;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1420 pEventTimer->Resume();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1421 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1422 viewparams->bRedrawGameUI = true;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1423 pIcons_LOD->_4355F7();
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1424 continue;
0
Ritor1
parents:
diff changeset
1425 default:
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1426 if ( pGUIWindow_Settings )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1427 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1428 if ( pCurrentScreen == SCREEN_CHARACTERS )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1429 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1430 pMouse->SetCursorBitmap("MICON2");
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1431 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1432 else
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1433 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1434 pGUIWindow_Settings->Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1435 pGUIWindow_Settings = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1436 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1437 GameUI_Footer_TimeLeft = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1438 unk_50C9A0 = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1439 back_to_game();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1440 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1441 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1442 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1443 uActiveCharacter = pParty->GetNextActiveCharacter();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1444 pGUIWindow_CurrentMenu->Release();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1445 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1446 window_SpeakInHouse = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1447 pGUIWindow_CurrentMenu = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1448 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1449 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1450 viewparams->bRedrawGameUI = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1451 pIcons_LOD->_4355F7();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1452 continue;
0
Ritor1
parents:
diff changeset
1453 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1454 if ( pGUIWindow_Settings )
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1455 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1456 if ( pCurrentScreen == SCREEN_CHARACTERS )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1457 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1458 pMouse->SetCursorBitmap("MICON2");
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1459 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1460 else
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1461 {
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1462 pGUIWindow_Settings->Release();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1463 pGUIWindow_Settings = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1464 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1465 GameUI_Footer_TimeLeft = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1466 unk_50C9A0 = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1467 back_to_game();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1468 }
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1469 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1470 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1471 uActiveCharacter = pParty->GetNextActiveCharacter();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1472 pGUIWindow_CurrentMenu->Release();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1473 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1474 window_SpeakInHouse = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1475 pGUIWindow_CurrentMenu = 0;
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1476 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1477 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1478 viewparams->bRedrawGameUI = true;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1479 pIcons_LOD->_4355F7();
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1480 continue;
0
Ritor1
parents:
diff changeset
1481 }
991
c5d8ea1e6ccb CharacterUI cleanings.
Nomad
parents: 984
diff changeset
1482 CharacterUI_ReleaseButtons();
0
Ritor1
parents:
diff changeset
1483 sub_419379();
Ritor1
parents:
diff changeset
1484 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
1485 }
Ritor1
parents:
diff changeset
1486 if ( pGUIWindow_Settings )
Ritor1
parents:
diff changeset
1487 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1488 if ( pCurrentScreen == SCREEN_CHARACTERS )
0
Ritor1
parents:
diff changeset
1489 {
Ritor1
parents:
diff changeset
1490 pMouse->SetCursorBitmap("MICON2");
Ritor1
parents:
diff changeset
1491 }
Ritor1
parents:
diff changeset
1492 else
Ritor1
parents:
diff changeset
1493 {
Ritor1
parents:
diff changeset
1494 pGUIWindow_Settings->Release();
Ritor1
parents:
diff changeset
1495 pGUIWindow_Settings = 0;
Ritor1
parents:
diff changeset
1496 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1497 GameUI_Footer_TimeLeft = 0;
0
Ritor1
parents:
diff changeset
1498 unk_50C9A0 = 0;
Ritor1
parents:
diff changeset
1499 back_to_game();
Ritor1
parents:
diff changeset
1500 }
Ritor1
parents:
diff changeset
1501 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1502 if ( (signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4 )
0
Ritor1
parents:
diff changeset
1503 uActiveCharacter = pParty->GetNextActiveCharacter();
Ritor1
parents:
diff changeset
1504 pGUIWindow_CurrentMenu->Release();
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1505 if ( pGUIWindow_CurrentMenu == window_SpeakInHouse )
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1506 window_SpeakInHouse = 0;
0
Ritor1
parents:
diff changeset
1507 pGUIWindow_CurrentMenu = 0;
Ritor1
parents:
diff changeset
1508 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1509 pCurrentScreen = SCREEN_GAME;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1510 viewparams->bRedrawGameUI = true;
0
Ritor1
parents:
diff changeset
1511 pIcons_LOD->_4355F7();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1512 continue;
0
Ritor1
parents:
diff changeset
1513 }
Ritor1
parents:
diff changeset
1514 if ( !pGUIWindow_Settings )//Draw Menu
Ritor1
parents:
diff changeset
1515 {
Ritor1
parents:
diff changeset
1516 dword_6BE138 = -1;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
1517 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1);
0
Ritor1
parents:
diff changeset
1518 pEventTimer->Pause();
Ritor1
parents:
diff changeset
1519 pAudioPlayer->StopChannels(-1, -1);
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1520 pCurrentScreen = SCREEN_MENU;
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1521
0
Ritor1
parents:
diff changeset
1522 ++pIcons_LOD->uTexturePacksCount;
Ritor1
parents:
diff changeset
1523 if ( !pIcons_LOD->uNumPrevLoadedFiles )
Ritor1
parents:
diff changeset
1524 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1525
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
1526 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0);
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1527 uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1528 uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1529 uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1530 uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1531 uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1532 uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
1533 uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1534 pBtn_NewGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu,
0
Ritor1
parents:
diff changeset
1535 pGlobalTXT_LocalizationStrings[614],// "New Game"
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1536 pIcons_LOD->GetTexture(uTextureID_New1), 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1537 pBtn_SaveGame = pGUIWindow_CurrentMenu->CreateButton(0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u,
0
Ritor1
parents:
diff changeset
1538 pGlobalTXT_LocalizationStrings[615],// "Save Game"
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1539 pIcons_LOD->GetTexture(uTextureID_Save1), 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1540 pBtn_LoadGame = pGUIWindow_CurrentMenu->CreateButton(19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu,
0
Ritor1
parents:
diff changeset
1541 pGlobalTXT_LocalizationStrings[616],// "Load Game"
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1542 pIcons_LOD->GetTexture(uTextureID_Load1), 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1543 pBtn_GameControls = pGUIWindow_CurrentMenu->CreateButton(241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u,
0
Ritor1
parents:
diff changeset
1544 pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:""
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1545 pIcons_LOD->GetTexture(uTextureID_Controls1), 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1546 pBtn_QuitGame = pGUIWindow_CurrentMenu->CreateButton(241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u,
0
Ritor1
parents:
diff changeset
1547 pGlobalTXT_LocalizationStrings[618],// "Quit"
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1548 pIcons_LOD->GetTexture(uTextureID_Quit1), 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1549 pBtn_Resume = pGUIWindow_CurrentMenu->CreateButton(241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u,
0
Ritor1
parents:
diff changeset
1550 pGlobalTXT_LocalizationStrings[619],// "Return to Game"
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1551 pIcons_LOD->GetTexture(uTextureID_Resume1), 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1552 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(6, 1, 0, 0);
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1553 viewparams->field_48 = 1;
0
Ritor1
parents:
diff changeset
1554 stru_506E40.Release();
Ritor1
parents:
diff changeset
1555 uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
Ritor1
parents:
diff changeset
1556 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
Ritor1
parents:
diff changeset
1557 free((void *)uNumSeconds);
Ritor1
parents:
diff changeset
1558 stru_506E40._40E55E("gamma.pcx", 0);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1559 continue;
0
Ritor1
parents:
diff changeset
1560 }
1000
Ritor1
parents: 999
diff changeset
1561 pGUIWindow_Settings->Release();
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1562 pGUIWindow_Settings = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1563 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1564 GameUI_Footer_TimeLeft = 0;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1565 unk_50C9A0 = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1566 back_to_game();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1567 continue;
0
Ritor1
parents:
diff changeset
1568 }
Ritor1
parents:
diff changeset
1569 sub_41426F();
Ritor1
parents:
diff changeset
1570 continue;
111
bf7ea4c330b3 Paperdoll fixed
Ritor1
parents: 110
diff changeset
1571 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
0
Ritor1
parents:
diff changeset
1572 if ( uMessageParam )
Ritor1
parents:
diff changeset
1573 {
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
1574 GUIWindow::Create(626, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCRight, 0);
0
Ritor1
parents:
diff changeset
1575 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2;
Ritor1
parents:
diff changeset
1576 if ( (unsigned __int8)pParty->field_709 < v37 )
Ritor1
parents:
diff changeset
1577 {
111
bf7ea4c330b3 Paperdoll fixed
Ritor1
parents: 110
diff changeset
1578 ++pParty->field_709;//??? maybe number of the first cell???
0
Ritor1
parents:
diff changeset
1579 if ( (unsigned __int8)pParty->field_709 >= v37 )
Ritor1
parents:
diff changeset
1580 pParty->field_709 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
Ritor1
parents:
diff changeset
1581 }
Ritor1
parents:
diff changeset
1582 }
Ritor1
parents:
diff changeset
1583 else
Ritor1
parents:
diff changeset
1584 {
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
1585 GUIWindow::Create(469, 179, 0, 0, WINDOW_PressedButton2, (int)pBtn_NPCLeft, 0);
0
Ritor1
parents:
diff changeset
1586 if ( pParty->field_709 )
Ritor1
parents:
diff changeset
1587 {
Ritor1
parents:
diff changeset
1588 --pParty->field_709;
Ritor1
parents:
diff changeset
1589 if ( pParty->field_709 < 1 )
Ritor1
parents:
diff changeset
1590 pParty->field_709 = 0;
Ritor1
parents:
diff changeset
1591 }
Ritor1
parents:
diff changeset
1592 }
994
3431f6abc786 GameUI clean
Nomad
parents: 992
diff changeset
1593 GameUI_DrawHiredNPCs();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1594 continue;
434
137c59c3dbc4 Temple of Moon and Dragon Lair can now be entered.
Nomad
parents: 430
diff changeset
1595 case UIMSG_TransitionUI_Confirm:
0
Ritor1
parents:
diff changeset
1596 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
1597 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1598 dword_50CDC8 = 1;
0
Ritor1
parents:
diff changeset
1599 sub_42FBDD();
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 735
diff changeset
1600 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful);
0
Ritor1
parents:
diff changeset
1601 pVideoPlayer->Unload();
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
1602 DialogueEnding();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1603 viewparams->bRedrawGameUI = 1;
0
Ritor1
parents:
diff changeset
1604 if ( dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz )
Ritor1
parents:
diff changeset
1605 {
Ritor1
parents:
diff changeset
1606 if ( dword_59117C_teleportx )
Ritor1
parents:
diff changeset
1607 {
Ritor1
parents:
diff changeset
1608 pParty->vPosition.x = dword_59117C_teleportx;
Ritor1
parents:
diff changeset
1609 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx;
Ritor1
parents:
diff changeset
1610 }
Ritor1
parents:
diff changeset
1611 if ( dword_591178_teleporty )
Ritor1
parents:
diff changeset
1612 {
Ritor1
parents:
diff changeset
1613 pParty->vPosition.y = dword_591178_teleporty;
Ritor1
parents:
diff changeset
1614 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty;
Ritor1
parents:
diff changeset
1615 }
Ritor1
parents:
diff changeset
1616 if ( dword_591174_teleportz )
Ritor1
parents:
diff changeset
1617 {
Ritor1
parents:
diff changeset
1618 pParty->vPosition.z = dword_591174_teleportz;
Ritor1
parents:
diff changeset
1619 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz;
Ritor1
parents:
diff changeset
1620 pParty->uFallStartY = dword_591174_teleportz;
Ritor1
parents:
diff changeset
1621 }
Ritor1
parents:
diff changeset
1622 if ( dword_591170_teleport_directiony )
Ritor1
parents:
diff changeset
1623 {
Ritor1
parents:
diff changeset
1624 pParty->sRotationY = dword_591170_teleport_directiony;
Ritor1
parents:
diff changeset
1625 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony;
Ritor1
parents:
diff changeset
1626 }
Ritor1
parents:
diff changeset
1627 if ( dword_59116C_teleport_directionx )
Ritor1
parents:
diff changeset
1628 {
Ritor1
parents:
diff changeset
1629 pParty->sRotationX = dword_59116C_teleport_directionx;
Ritor1
parents:
diff changeset
1630 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx;
Ritor1
parents:
diff changeset
1631 v38 = dword_591168_teleport_speedz;
Ritor1
parents:
diff changeset
1632 pParty->uFallSpeed = dword_591168_teleport_speedz;
Ritor1
parents:
diff changeset
1633 dword_5B65BC = dword_591168_teleport_speedz;
Ritor1
parents:
diff changeset
1634 }
Ritor1
parents:
diff changeset
1635 else
Ritor1
parents:
diff changeset
1636 {
Ritor1
parents:
diff changeset
1637 v38 = dword_5B65BC;
Ritor1
parents:
diff changeset
1638 }
Ritor1
parents:
diff changeset
1639 if ( *dword_591164_teleport_map_name != 48 )
Ritor1
parents:
diff changeset
1640 {
Ritor1
parents:
diff changeset
1641 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2;
Ritor1
parents:
diff changeset
1642 dword_5B65C0 = _5B65A8_npcdata_uflags_or_other | _5B65AC_npcdata_fame_or_other | _5B65B0_npcdata_rep_or_other | _5B65B4_npcdata_loword_house_or_other | _5B65B8_npcdata_hiword_house_or_other | v38;
Ritor1
parents:
diff changeset
1643 OnMapLeave();
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1644 sub_44987B(dword_591164_teleport_map_name, MapStartPoint_Party);
0
Ritor1
parents:
diff changeset
1645 }
Ritor1
parents:
diff changeset
1646 }
Ritor1
parents:
diff changeset
1647 else
Ritor1
parents:
diff changeset
1648 {
1052
d48c762de563 -nomarg
Nomad
parents: 1051
diff changeset
1649 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
d48c762de563 -nomarg
Nomad
parents: 1051
diff changeset
1650 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1651 if ( !_stricmp(byte_6BE3B0.data(), "d05.blv") )
0
Ritor1
parents:
diff changeset
1652 pParty->uTimePlayed += 1474560i64;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1653 continue;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
1654 case UIMSG_TransitionWindowCloseBtn:
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1655 CloseWindowBackground();
0
Ritor1
parents:
diff changeset
1656 pVideoPlayer->Unload();
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
1657 DialogueEnding();
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1658 viewparams->bRedrawGameUI = true;
910
Ritor1
parents: 907
diff changeset
1659 continue;
0
Ritor1
parents:
diff changeset
1660 case UIMSG_CycleCharacters:
Ritor1
parents:
diff changeset
1661 v39 = GetAsyncKeyState(VK_SHIFT);
910
Ritor1
parents: 907
diff changeset
1662 uActiveCharacter = CycleCharacter(v39);
1035
306ec23b37df 004C1EE5 & other stuff
Nomad
parents: 1033
diff changeset
1663 viewparams->bRedrawGameUI = true;
910
Ritor1
parents: 907
diff changeset
1664 continue;
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1665 case UIMSG_OnTravelByFoot:
0
Ritor1
parents:
diff changeset
1666 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
1667 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1668 dword_50CDC8 = 1;
0
Ritor1
parents:
diff changeset
1669 sub_42FBDD();
Ritor1
parents:
diff changeset
1670 pNPCData4 = (NPCData *)GetTravelTime();
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1671 strcpy(pOutdoor->pLevelFilename, pCurrentMapName.data());
0
Ritor1
parents:
diff changeset
1672 if ( bUnderwater != 1 && pParty->bFlying
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1673 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1 )
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1674 {
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1675 viewparams->bRedrawGameUI = 1;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1676 CloseWindowBackground();
0
Ritor1
parents:
diff changeset
1677 if ( pParty->vPosition.x < -22528 )
Ritor1
parents:
diff changeset
1678 pParty->vPosition.x = -22528;
Ritor1
parents:
diff changeset
1679 if ( pParty->vPosition.x > 22528 )
Ritor1
parents:
diff changeset
1680 pParty->vPosition.x = 22528;
Ritor1
parents:
diff changeset
1681 if ( pParty->vPosition.y < -22528 )
Ritor1
parents:
diff changeset
1682 pParty->vPosition.y = -22528;
Ritor1
parents:
diff changeset
1683 if ( pParty->vPosition.y > 22528 )
Ritor1
parents:
diff changeset
1684 pParty->vPosition.y = 22528;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
1685 DialogueEnding();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1686 pCurrentScreen = SCREEN_GAME;
0
Ritor1
parents:
diff changeset
1687 }
Ritor1
parents:
diff changeset
1688 else
Ritor1
parents:
diff changeset
1689 {
Ritor1
parents:
diff changeset
1690 pParty->field_6E4 = 0;
Ritor1
parents:
diff changeset
1691 pParty->field_6E0 = 0;
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1184
diff changeset
1692 pCastSpellInfo.data()->_427D48(1);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
1693 DialogueEnding();
0
Ritor1
parents:
diff changeset
1694 pEventTimer->Pause();
434
137c59c3dbc4 Temple of Moon and Dragon Lair can now be entered.
Nomad
parents: 430
diff changeset
1695 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box);
0
Ritor1
parents:
diff changeset
1696 ++pGameLoadingUI_ProgressBar->uProgressMax;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1697 SaveGame(1, 0);
0
Ritor1
parents:
diff changeset
1698 pGameLoadingUI_ProgressBar->Progress();
Ritor1
parents:
diff changeset
1699 RestAndHeal(1440 * (signed int)pNPCData4);
Ritor1
parents:
diff changeset
1700 if ( pParty->uNumFoodRations )
Ritor1
parents:
diff changeset
1701 {
Ritor1
parents:
diff changeset
1702 pParty->RestAndHeal();
Ritor1
parents:
diff changeset
1703 if ( ((pParty->uNumFoodRations - (signed int)pNPCData4) & 0x80000000u) != 0 )
Ritor1
parents:
diff changeset
1704 {
Ritor1
parents:
diff changeset
1705 pPlayer7 = pParty->pPlayers;
Ritor1
parents:
diff changeset
1706 do
Ritor1
parents:
diff changeset
1707 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1708 pPlayer7->SetCondition(1, 0);
0
Ritor1
parents:
diff changeset
1709 ++pPlayer7;
Ritor1
parents:
diff changeset
1710 }
Ritor1
parents:
diff changeset
1711 while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings );
766
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
1712 ++pParty->days_played_without_rest;
0
Ritor1
parents:
diff changeset
1713 }
Ritor1
parents:
diff changeset
1714 Party::TakeFood((unsigned int)pNPCData4);
Ritor1
parents:
diff changeset
1715 }
Ritor1
parents:
diff changeset
1716 else
Ritor1
parents:
diff changeset
1717 {
Ritor1
parents:
diff changeset
1718 pPlayer8 = pParty->pPlayers;
Ritor1
parents:
diff changeset
1719 do
Ritor1
parents:
diff changeset
1720 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1721 pPlayer8->SetCondition(1, 0);
0
Ritor1
parents:
diff changeset
1722 ++pPlayer8;
Ritor1
parents:
diff changeset
1723 }
Ritor1
parents:
diff changeset
1724 while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings );
766
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
1725 ++pParty->days_played_without_rest;
0
Ritor1
parents:
diff changeset
1726 }
Ritor1
parents:
diff changeset
1727 pPaletteManager->ResetNonLocked();
Ritor1
parents:
diff changeset
1728 pSpriteFrameTable->ResetSomeSpriteFlags();
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1729 strcpy(pCurrentMapName.data(), pOut);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1730 strcpy(pLevelName, pCurrentMapName.data());
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1731 v41 = strtok(pLevelName, ".");
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1732 strcpy(pLevelName, v41);
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1733 Level_LoadEvtAndStr(pLevelName);
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1734 pDecalBuilder->Reset(0);
0
Ritor1
parents:
diff changeset
1735 LoadLevel_InitializeLevelEvt();
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1736 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName.data());
0
Ritor1
parents:
diff changeset
1737 bUnderwater = 0;
Ritor1
parents:
diff changeset
1738 bNoNPCHiring = 0;
Ritor1
parents:
diff changeset
1739 pGame->uFlags2 &= 0xFFFFFFF7u;
Ritor1
parents:
diff changeset
1740 if ( Is_out15odm_underwater() )
Ritor1
parents:
diff changeset
1741 {
Ritor1
parents:
diff changeset
1742 bUnderwater = 1;
Ritor1
parents:
diff changeset
1743 pGame->uFlags2 |= 8u;
Ritor1
parents:
diff changeset
1744 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1745 if ( !_stricmp(pCurrentMapName.data(), "out15.odm") || !_stricmp(pCurrentMapName.data(), "d47.blv") )
0
Ritor1
parents:
diff changeset
1746 bNoNPCHiring = 1;
Ritor1
parents:
diff changeset
1747 PrepareToLoadODM(1u, (OutdoorCamera *)1);
Ritor1
parents:
diff changeset
1748 pAudioPlayer->SetMapEAX();
Ritor1
parents:
diff changeset
1749 bDialogueUI_InitializeActor_NPC_ID = 0;
Ritor1
parents:
diff changeset
1750 OnMapLoad();
Ritor1
parents:
diff changeset
1751 pOutdoor->SetFog();
Ritor1
parents:
diff changeset
1752 TeleportToStartingPoint(uLevel_StartingPointType);
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1753 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0);
0
Ritor1
parents:
diff changeset
1754 pParty->uFallStartY = pParty->vPosition.z;
Ritor1
parents:
diff changeset
1755 sub_461103();
Ritor1
parents:
diff changeset
1756 pEventTimer->Resume();
Ritor1
parents:
diff changeset
1757 viewparams->bRedrawGameUI = 1;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
1758 pCurrentScreen = SCREEN_GAME;
0
Ritor1
parents:
diff changeset
1759 pGameLoadingUI_ProgressBar->Release();
Ritor1
parents:
diff changeset
1760 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1761 viewparams->bRedrawGameUI = 1;
910
Ritor1
parents: 907
diff changeset
1762 continue;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1763 case UIMSG_CHANGE_LOCATION_ClickCencelBtn:
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1764 CloseWindowBackground();
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1765 if ( pParty->vPosition.x < -22528 )
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1766 pParty->vPosition.x = -22528;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1767 if ( pParty->vPosition.x > 22528 )
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1768 pParty->vPosition.x = 22528;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1769 if ( pParty->vPosition.y < -22528 )
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1770 pParty->vPosition.y = -22528;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1771 if ( pParty->vPosition.y > 22528 )
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1772 pParty->vPosition.y = 22528;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1773 DialogueEnding();
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1774 pCurrentScreen = SCREEN_GAME;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1775 viewparams->bRedrawGameUI = 1;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1776 continue;
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1777 case UIMSG_CastSpell_BE://???
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1778 __debugbreak();
0
Ritor1
parents:
diff changeset
1779 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
1780 {
Ritor1
parents:
diff changeset
1781 LOWORD(v42) = pGame->pVisInstance->get_picked_object_zbuf_val();
Ritor1
parents:
diff changeset
1782 }
Ritor1
parents:
diff changeset
1783 else
Ritor1
parents:
diff changeset
1784 {
Ritor1
parents:
diff changeset
1785 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210);
Ritor1
parents:
diff changeset
1786 pPoint = pMouse->GetCursorPos(&v208);
Ritor1
parents:
diff changeset
1787 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]];
Ritor1
parents:
diff changeset
1788 }
Ritor1
parents:
diff changeset
1789 v44 = (unsigned __int16)v42;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
1790 v45 = PID_TYPE(v44);
0
Ritor1
parents:
diff changeset
1791 uNumSeconds = v44;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
1792 v46 = PID_ID(v44);
0
Ritor1
parents:
diff changeset
1793 if ( v45 == 3 )
Ritor1
parents:
diff changeset
1794 {
Ritor1
parents:
diff changeset
1795 v47 = pActors[v46].uAIState == Dead;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1796 if ( !v47 )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1797 continue;
1000
Ritor1
parents: 999
diff changeset
1798 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
Ritor1
parents: 999
diff changeset
1799 LOBYTE(pSpellInfo->field_8) &= 0xBFu;
Ritor1
parents: 999
diff changeset
1800 pSpellInfo->uPlayerID_2 = uMessageParam;
Ritor1
parents: 999
diff changeset
1801 pSpellInfo->spell_target_pid = v44;
Ritor1
parents: 999
diff changeset
1802 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
Ritor1
parents: 999
diff changeset
1803 pGUIWindow_Settings->Release();
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1804 pGUIWindow_Settings = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1805 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1806 GameUI_Footer_TimeLeft = 0;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1807 unk_50C9A0 = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1808 back_to_game();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1809 continue;
0
Ritor1
parents:
diff changeset
1810 }
Ritor1
parents:
diff changeset
1811 if ( v45 == 2 )
Ritor1
parents:
diff changeset
1812 {
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
1813 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0;
0
Ritor1
parents:
diff changeset
1814 if ( !v47 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1815 continue;
1000
Ritor1
parents: 999
diff changeset
1816 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
Ritor1
parents: 999
diff changeset
1817 LOBYTE(pSpellInfo->field_8) &= 0xBFu;
Ritor1
parents: 999
diff changeset
1818 pSpellInfo->uPlayerID_2 = uMessageParam;
Ritor1
parents: 999
diff changeset
1819 pSpellInfo->spell_target_pid = v44;
Ritor1
parents: 999
diff changeset
1820 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
Ritor1
parents: 999
diff changeset
1821 pGUIWindow_Settings->Release();
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1822 pGUIWindow_Settings = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1823 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1824 GameUI_Footer_TimeLeft = 0;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1825 unk_50C9A0 = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1826 back_to_game();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1827 continue;
0
Ritor1
parents:
diff changeset
1828 }
Ritor1
parents:
diff changeset
1829 if ( v45 == 5 )
Ritor1
parents:
diff changeset
1830 {
Ritor1
parents:
diff changeset
1831 v48 = pLevelDecorations[v46].field_16_event_id == 0;
Ritor1
parents:
diff changeset
1832 }
Ritor1
parents:
diff changeset
1833 else
Ritor1
parents:
diff changeset
1834 {
Ritor1
parents:
diff changeset
1835 if ( v45 != 6 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1836 continue;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1837 if ( uCurrentlyLoadedLevelType != 1 )
0
Ritor1
parents:
diff changeset
1838 {
Ritor1
parents:
diff changeset
1839 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
Ritor1
parents:
diff changeset
1840 if ( !(pODMFace->uAttributes & 0x02000000) || !pODMFace->sCogTriggeredID )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1841 continue;
0
Ritor1
parents:
diff changeset
1842 v44 = uNumSeconds;
1000
Ritor1
parents: 999
diff changeset
1843 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
Ritor1
parents: 999
diff changeset
1844 LOBYTE(pSpellInfo->field_8) &= 0xBFu;
Ritor1
parents: 999
diff changeset
1845 pSpellInfo->uPlayerID_2 = uMessageParam;
Ritor1
parents: 999
diff changeset
1846 pSpellInfo->spell_target_pid = v44;
Ritor1
parents: 999
diff changeset
1847 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
Ritor1
parents: 999
diff changeset
1848 pGUIWindow_Settings->Release();
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1849 pGUIWindow_Settings = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1850 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1851 GameUI_Footer_TimeLeft = 0;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1852 unk_50C9A0 = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1853 back_to_game();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1854 continue;
0
Ritor1
parents:
diff changeset
1855 }
Ritor1
parents:
diff changeset
1856 pBLVFace = &pIndoor->pFaces[v46];
Ritor1
parents:
diff changeset
1857 if ( !(BYTE3(pBLVFace->uAttributes) & 2) )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1858 continue;
0
Ritor1
parents:
diff changeset
1859 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0;
Ritor1
parents:
diff changeset
1860 }
Ritor1
parents:
diff changeset
1861 if ( v48 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1862 continue;
1000
Ritor1
parents: 999
diff changeset
1863 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
Ritor1
parents: 999
diff changeset
1864 LOBYTE(pSpellInfo->field_8) &= 0xBFu;
Ritor1
parents: 999
diff changeset
1865 pSpellInfo->uPlayerID_2 = uMessageParam;
Ritor1
parents: 999
diff changeset
1866 pSpellInfo->spell_target_pid = v44;
Ritor1
parents: 999
diff changeset
1867 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
Ritor1
parents: 999
diff changeset
1868 pGUIWindow_Settings->Release();
0
Ritor1
parents:
diff changeset
1869 pGUIWindow_Settings = 0;
Ritor1
parents:
diff changeset
1870 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1871 GameUI_Footer_TimeLeft = 0;
0
Ritor1
parents:
diff changeset
1872 unk_50C9A0 = 0;
Ritor1
parents:
diff changeset
1873 back_to_game();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1874 continue;
1000
Ritor1
parents: 999
diff changeset
1875 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade)
Ritor1
parents: 999
diff changeset
1876 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure
Ritor1
parents: 999
diff changeset
1877 case UIMSG_HiredNPC_CastSpell:
0
Ritor1
parents:
diff changeset
1878 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
1879 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
1880 if ( unk_50C9A0 )
Ritor1
parents:
diff changeset
1881 {
910
Ritor1
parents: 907
diff changeset
1882 uActiveCharacter = uMessageParam;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1883 viewparams->bRedrawGameUI = 1;
0
Ritor1
parents:
diff changeset
1884 }
Ritor1
parents:
diff changeset
1885 else
Ritor1
parents:
diff changeset
1886 {
Ritor1
parents:
diff changeset
1887 if ( pGUIWindow_Settings )
Ritor1
parents:
diff changeset
1888 {
1000
Ritor1
parents: 999
diff changeset
1889 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
0
Ritor1
parents:
diff changeset
1890 switch ( uMessage )
Ritor1
parents:
diff changeset
1891 {
1000
Ritor1
parents: 999
diff changeset
1892 case UIMSG_CastSpell_Character_Big_Improvement:
Ritor1
parents: 999
diff changeset
1893 LOBYTE(pSpellInfo->field_8) &= 0xFDu;
0
Ritor1
parents:
diff changeset
1894 break;
1000
Ritor1
parents: 999
diff changeset
1895 case UIMSG_CastSpell_Character_Small_Improvement:
Ritor1
parents: 999
diff changeset
1896 HIBYTE(pSpellInfo->field_8) &= 0xFEu;
0
Ritor1
parents:
diff changeset
1897 break;
1000
Ritor1
parents: 999
diff changeset
1898 case UIMSG_HiredNPC_CastSpell:
Ritor1
parents: 999
diff changeset
1899 HIBYTE(pSpellInfo->field_8) &= 0xFDu;
0
Ritor1
parents:
diff changeset
1900 break;
Ritor1
parents:
diff changeset
1901 }
1000
Ritor1
parents: 999
diff changeset
1902 pSpellInfo->uPlayerID_2 = uMessageParam;
Ritor1
parents: 999
diff changeset
1903 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
0
Ritor1
parents:
diff changeset
1904 pGUIWindow_Settings->Release();
Ritor1
parents:
diff changeset
1905 pGUIWindow_Settings = 0;
Ritor1
parents:
diff changeset
1906 pEventTimer->Resume();
Ritor1
parents:
diff changeset
1907 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
1908 GameUI_Footer_TimeLeft = 0;
0
Ritor1
parents:
diff changeset
1909 unk_50C9A0 = 0;
Ritor1
parents:
diff changeset
1910 }
Ritor1
parents:
diff changeset
1911 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1912 continue;
0
Ritor1
parents:
diff changeset
1913 case UIMSG_BF:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
1914 __debugbreak();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1915 dword_50CDC8 = 1;
0
Ritor1
parents:
diff changeset
1916 sub_42FBDD();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1917 SaveGame(1, 0);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1918 strcpy(pCurrentMapName.data(), pMapStats->pInfos[uHouse_ExitPic].pFilename);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1919 dword_6BE364_game_settings_1 |= 1;
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1920 uGameState = GAME_STATE_2;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1921 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
336
ea55d6414029 Event_proceccor preliminary
Gloval
parents: 328
diff changeset
1922 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1923 if ( v53 < 0 )
0
Ritor1
parents:
diff changeset
1924 {
Ritor1
parents:
diff changeset
1925 v54 = abs(v53) - 1;
Ritor1
parents:
diff changeset
1926 _5B65B8_npcdata_hiword_house_or_other = 0;
Ritor1
parents:
diff changeset
1927 dword_5B65BC = 0;
Ritor1
parents:
diff changeset
1928 v55 = dword_4E4560[v54];
Ritor1
parents:
diff changeset
1929 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54];
Ritor1
parents:
diff changeset
1930 v56 = dword_4E4590[v54];
Ritor1
parents:
diff changeset
1931 v57 = dword_4E45A8[v54];
Ritor1
parents:
diff changeset
1932 _5B65A8_npcdata_uflags_or_other = v55;
Ritor1
parents:
diff changeset
1933 _5B65B4_npcdata_loword_house_or_other = v57;
Ritor1
parents:
diff changeset
1934 _5B65B0_npcdata_rep_or_other = v56;
Ritor1
parents:
diff changeset
1935 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
Ritor1
parents:
diff changeset
1936 }
Ritor1
parents:
diff changeset
1937 sub_4BD8B5();
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1938 //goto LABEL_434;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
1939 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1940 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1941 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1942 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1943 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1944 ++pMessageQueue_50CBD0->uNumMessages;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
1945 }*/
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1946 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1947 continue;
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1948
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1949 case UIMSG_OnCastTownPortal:
0
Ritor1
parents:
diff changeset
1950 pAudioPlayer->StopChannels(-1, -1);
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
1951 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam);
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1952 continue;
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1953
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
1954 case UIMSG_OnCastLloydsBeacon:
0
Ritor1
parents:
diff changeset
1955 pAudioPlayer->StopChannels(-1, -1);
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
1956 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_LloydsBeacon, 0);
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1957 continue;
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
1958
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
1959 case UIMSG_LloydsBeacon_FlippingBtn:
0
Ritor1
parents:
diff changeset
1960 bRecallingBeacon = uMessageParam;
Ritor1
parents:
diff changeset
1961 v127 = uMessageParam + 204;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
1962 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
1963 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
1964 case UIMSG_HintBeaconSlot:
0
Ritor1
parents:
diff changeset
1965 if ( !pGUIWindow_CurrentMenu )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1966 continue;
0
Ritor1
parents:
diff changeset
1967 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1];
Ritor1
parents:
diff changeset
1968 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam];
Ritor1
parents:
diff changeset
1969 if ( bRecallingBeacon )
Ritor1
parents:
diff changeset
1970 {
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
1971 if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
1972 continue;
0
Ritor1
parents:
diff changeset
1973 v173 = pMapStats->pInfos[sub_410D99_get_map_index(HIWORD(pPlayer->pInstalledBeacons[uMessageParam].field_18))].pName;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1974 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1975 GameUI_SetFooterString(pTmpBuf.data());
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
1976 continue;
0
Ritor1
parents:
diff changeset
1977 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1978 v59 = pMapStats->GetMapInfo(pCurrentMapName.data());
0
Ritor1
parents:
diff changeset
1979 thise = "Not in Map Stats";
Ritor1
parents:
diff changeset
1980 if ( v59 )
Ritor1
parents:
diff changeset
1981 thise = pMapStats->pInfos[v59].pName;
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
1982 if ( !*((int *)&pSavegameThumbnails.data()->pPixels + 10 * uMessageParam) || !v59 )
0
Ritor1
parents:
diff changeset
1983 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1984 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], thise);// "Set to %s"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1985 GameUI_SetFooterString(pTmpBuf.data());
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
1986 continue;
0
Ritor1
parents:
diff changeset
1987 }
Ritor1
parents:
diff changeset
1988 v174 = pMapStats->pInfos[sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
Ritor1
parents:
diff changeset
1989 v158 = (unsigned int)thise;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1990 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], v158, v174);// "Set %s over %s"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1991 GameUI_SetFooterString(pTmpBuf.data());
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1992 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
1993 case UIMSG_CloseAfterInstallBeacon:
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
1994 dword_50CDC8 = 1;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
1995 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
1996 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1997 continue;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
1998 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
1999 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2000 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2001 ++pMessageQueue_50CBD0->uNumMessages;*/
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2002 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2003 case UIMSG_InstallBeacon:
0
Ritor1
parents:
diff changeset
2004 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
Ritor1
parents:
diff changeset
2005 pNPCData4 = (NPCData *)&pPlayer9->pInstalledBeacons[uMessageParam];
Ritor1
parents:
diff changeset
2006 if ( !*(_QWORD *)&pNPCData4->pName && bRecallingBeacon )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2007 continue;
0
Ritor1
parents:
diff changeset
2008 byte_506360 = 1;
Ritor1
parents:
diff changeset
2009 pPlayer9->CanCastSpell(uRequiredMana);
Ritor1
parents:
diff changeset
2010 if ( pParty->bTurnBasedModeOn )
Ritor1
parents:
diff changeset
2011 {
Ritor1
parents:
diff changeset
2012 v60 = sRecoveryTime;
Ritor1
parents:
diff changeset
2013 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime;
Ritor1
parents:
diff changeset
2014 pPlayer9->SetRecoveryTime(v60);
Ritor1
parents:
diff changeset
2015 pTurnEngine->_40471C();
Ritor1
parents:
diff changeset
2016 }
Ritor1
parents:
diff changeset
2017 else
Ritor1
parents:
diff changeset
2018 {
Ritor1
parents:
diff changeset
2019 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
Ritor1
parents:
diff changeset
2020 }
Ritor1
parents:
diff changeset
2021 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[dword_506338], 0, 0, -1, 0, dword_50633C, 0, 0);
Ritor1
parents:
diff changeset
2022 if ( bRecallingBeacon )
Ritor1
parents:
diff changeset
2023 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2024 if ( _stricmp(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]) )
0
Ritor1
parents:
diff changeset
2025 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2026 SaveGame(1, 0);
0
Ritor1
parents:
diff changeset
2027 OnMapLeave();
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2028 strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[HIWORD(pNPCData4->uProfession)]);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2029 dword_6BE364_game_settings_1 |= 1;
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2030 uGameState = GAME_STATE_2;
0
Ritor1
parents:
diff changeset
2031 _5B65A8_npcdata_uflags_or_other = pNPCData4->uFlags;
Ritor1
parents:
diff changeset
2032 _5B65AC_npcdata_fame_or_other = pNPCData4->fame;
Ritor1
parents:
diff changeset
2033 _5B65B0_npcdata_rep_or_other = pNPCData4->rep;
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 289
diff changeset
2034 _5B65B4_npcdata_loword_house_or_other = LOWORD(pNPCData4->Location2D);
0ea5fbd16edb NPC mostly done
Gloval
parents: 289
diff changeset
2035 _5B65B8_npcdata_hiword_house_or_other = HIWORD(pNPCData4->Location2D);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2036 dword_5B65C0 = 1;
0
Ritor1
parents:
diff changeset
2037 }
Ritor1
parents:
diff changeset
2038 else
Ritor1
parents:
diff changeset
2039 {
Ritor1
parents:
diff changeset
2040 pParty->vPosition.x = pNPCData4->uFlags;
Ritor1
parents:
diff changeset
2041 pParty->vPosition.y = pNPCData4->fame;
Ritor1
parents:
diff changeset
2042 pParty->vPosition.z = pNPCData4->rep;
Ritor1
parents:
diff changeset
2043 pParty->uFallStartY = pParty->vPosition.z;
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 289
diff changeset
2044 pParty->sRotationY = LOWORD(pNPCData4->Location2D);
0ea5fbd16edb NPC mostly done
Gloval
parents: 289
diff changeset
2045 pParty->sRotationX = HIWORD(pNPCData4->Location2D);
0
Ritor1
parents:
diff changeset
2046 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2047 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2048 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0
Ritor1
parents:
diff changeset
2049 {
305
cc8e4dc397ec MonsterPopup_Draw crash fix
Nomad
parents: 304
diff changeset
2050 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
0
Ritor1
parents:
diff changeset
2051 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
Ritor1
parents:
diff changeset
2052 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
2053 ++pMessageQueue_50CBD0->uNumMessages;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2054 }*/
0
Ritor1
parents:
diff changeset
2055 //crt_deconstruct_ptr_6A0118();
Ritor1
parents:
diff changeset
2056 pBooksWindow->Release();
Ritor1
parents:
diff changeset
2057 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
2058 pBooksWindow = 0;
Ritor1
parents:
diff changeset
2059 pGUIWindow_CurrentMenu = 0;
Ritor1
parents:
diff changeset
2060 }
Ritor1
parents:
diff changeset
2061 else
Ritor1
parents:
diff changeset
2062 {
Ritor1
parents:
diff changeset
2063 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1);
Ritor1
parents:
diff changeset
2064 SaveScreenshot(a1);
Ritor1
parents:
diff changeset
2065 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1);
Ritor1
parents:
diff changeset
2066 v212 = qword_506350 << 7;
Ritor1
parents:
diff changeset
2067 pNPCData2 = pNPCData4;
Ritor1
parents:
diff changeset
2068 thisg = 0;
Ritor1
parents:
diff changeset
2069 v62 = pParty->uTimePlayed + (signed __int64)((double)(qword_506350 << 7) * 0.033333335);
Ritor1
parents:
diff changeset
2070 pNPCData4->pName = (char *)v62;
Ritor1
parents:
diff changeset
2071 pNPCData2->uPortraitID = HIDWORD(v62);
Ritor1
parents:
diff changeset
2072 pNPCData2->uFlags = pParty->vPosition.x;
Ritor1
parents:
diff changeset
2073 pNPCData2->fame = pParty->vPosition.y;
Ritor1
parents:
diff changeset
2074 pNPCData2->rep = pParty->vPosition.z;
291
0ea5fbd16edb NPC mostly done
Gloval
parents: 289
diff changeset
2075 LOWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationY);
0ea5fbd16edb NPC mostly done
Gloval
parents: 289
diff changeset
2076 HIWORD(pNPCData2->Location2D) = LOWORD(pParty->sRotationX);
837
bebc19f3d2af Save/load work with some problems
Gloval
parents: 821
diff changeset
2077 if ( (signed int)pGames_LOD->uNumSubDirs / 2 <= 0 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2078 continue;
0
Ritor1
parents:
diff changeset
2079 uAction = 0;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2080 while ( _stricmp((const char *)pGames_LOD->pSubIndices + uAction, pCurrentMapName.data()) )
0
Ritor1
parents:
diff changeset
2081 {
Ritor1
parents:
diff changeset
2082 ++thisg;
Ritor1
parents:
diff changeset
2083 uAction += 32;
837
bebc19f3d2af Save/load work with some problems
Gloval
parents: 821
diff changeset
2084 if ( thisg >= (signed int)pGames_LOD->uNumSubDirs / 2 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2085 continue;
0
Ritor1
parents:
diff changeset
2086 }
Ritor1
parents:
diff changeset
2087 HIWORD(pNPCData4->uProfession) = thisg;
Ritor1
parents:
diff changeset
2088 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2089 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2090 case UIMSG_ClickTownInTP:
0
Ritor1
parents:
diff changeset
2091 if ( uMessageParam )
Ritor1
parents:
diff changeset
2092 {
Ritor1
parents:
diff changeset
2093 switch ( uMessageParam )
Ritor1
parents:
diff changeset
2094 {
Ritor1
parents:
diff changeset
2095 case 1:
Ritor1
parents:
diff changeset
2096 v63 = 208;
Ritor1
parents:
diff changeset
2097 break;
Ritor1
parents:
diff changeset
2098 case 2:
Ritor1
parents:
diff changeset
2099 v63 = 207;
Ritor1
parents:
diff changeset
2100 break;
Ritor1
parents:
diff changeset
2101 case 3:
Ritor1
parents:
diff changeset
2102 v63 = 211;
Ritor1
parents:
diff changeset
2103 break;
Ritor1
parents:
diff changeset
2104 case 4:
Ritor1
parents:
diff changeset
2105 v63 = 209;
Ritor1
parents:
diff changeset
2106 break;
Ritor1
parents:
diff changeset
2107 default:
Ritor1
parents:
diff changeset
2108 if ( uMessageParam != 5 )
Ritor1
parents:
diff changeset
2109 {
Ritor1
parents:
diff changeset
2110 LABEL_486:
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2111 SaveGame(1, 0);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2112 v64 = pMapStats->GetMapInfo(pCurrentMapName.data());
0
Ritor1
parents:
diff changeset
2113 v65 = uMessageParam;
839
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2114 if ( v64 == TownPortalList[uMessageParam].uMapInfoID )
0
Ritor1
parents:
diff changeset
2115 {
839
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2116 pParty->vPosition.x = TownPortalList[v65].pos.x;
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2117 pParty->vPosition.y = TownPortalList[v65].pos.y;
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2118 pParty->vPosition.z = TownPortalList[v65].pos.z;
0
Ritor1
parents:
diff changeset
2119 pParty->uFallStartY = pParty->vPosition.z;
839
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2120 pParty->sRotationY = TownPortalList[v65].rot_y;
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2121 pParty->sRotationX = TownPortalList[v65].rot_x;
0
Ritor1
parents:
diff changeset
2122 }
Ritor1
parents:
diff changeset
2123 else
Ritor1
parents:
diff changeset
2124 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2125 SaveGame(1, 0);
0
Ritor1
parents:
diff changeset
2126 OnMapLeave();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2127 dword_6BE364_game_settings_1 |= 1;
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2128 uGameState = GAME_STATE_2;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2129 strcpy(pCurrentMapName.data(), pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2130 dword_5B65C0 = 1;
839
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2131 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x;
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2132 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y;
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2133 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z;
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2134 v66 = TownPortalList[uMessageParam].rot_x;
ae8f83e1b0cf coordinates for the town portal
x1diablo
parents: 838
diff changeset
2135 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y;
0
Ritor1
parents:
diff changeset
2136 _5B65B8_npcdata_hiword_house_or_other = v66;
Ritor1
parents:
diff changeset
2137 InitializeActors();
Ritor1
parents:
diff changeset
2138 }
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
2139 v67 = (char*)pGUIWindow_CurrentMenu->Hint;
0
Ritor1
parents:
diff changeset
2140 if ( v67 )
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2141 *((int *)v67 + 17) = 1;
0
Ritor1
parents:
diff changeset
2142 else
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
2143 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2144 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0
Ritor1
parents:
diff changeset
2145 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2146 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
0
Ritor1
parents:
diff changeset
2147 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v0;
Ritor1
parents:
diff changeset
2148 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
2149 ++pMessageQueue_50CBD0->uNumMessages;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2150 }*/
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2151 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2152 continue;
0
Ritor1
parents:
diff changeset
2153 }
Ritor1
parents:
diff changeset
2154 v63 = 210;
Ritor1
parents:
diff changeset
2155 break;
Ritor1
parents:
diff changeset
2156 }
Ritor1
parents:
diff changeset
2157 }
Ritor1
parents:
diff changeset
2158 else
Ritor1
parents:
diff changeset
2159 {
Ritor1
parents:
diff changeset
2160 v63 = 206;
Ritor1
parents:
diff changeset
2161 }
484
4bd56919f075 avard quest guild bits
Gloval
parents: 467
diff changeset
2162 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63) )
0
Ritor1
parents:
diff changeset
2163 return;
Ritor1
parents:
diff changeset
2164 goto LABEL_486;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2165 case UIMSG_HintTownPortal:
0
Ritor1
parents:
diff changeset
2166 if ( uMessageParam )
Ritor1
parents:
diff changeset
2167 {
Ritor1
parents:
diff changeset
2168 switch ( uMessageParam )
Ritor1
parents:
diff changeset
2169 {
Ritor1
parents:
diff changeset
2170 case 1:
Ritor1
parents:
diff changeset
2171 v68 = 208;
Ritor1
parents:
diff changeset
2172 break;
Ritor1
parents:
diff changeset
2173 case 2:
Ritor1
parents:
diff changeset
2174 v68 = 207;
Ritor1
parents:
diff changeset
2175 break;
Ritor1
parents:
diff changeset
2176 case 3:
Ritor1
parents:
diff changeset
2177 v68 = 211;
Ritor1
parents:
diff changeset
2178 break;
Ritor1
parents:
diff changeset
2179 case 4:
Ritor1
parents:
diff changeset
2180 v68 = 209;
Ritor1
parents:
diff changeset
2181 break;
Ritor1
parents:
diff changeset
2182 default:
Ritor1
parents:
diff changeset
2183 if ( uMessageParam != 5 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2184 //goto LABEL_506;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2185 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2186 if ( uMessageParam )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2187 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2188 switch ( uMessageParam )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2189 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2190 case 1:
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2191 v69 = pMapStats->pInfos[4].pName;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2192 break;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2193 case 2:
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2194 v69 = pMapStats->pInfos[3].pName;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2195 break;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2196 case 3:
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2197 v69 = pMapStats->pInfos[10].pName;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2198 break;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2199 case 4:
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2200 v69 = pMapStats->pInfos[7].pName;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2201 break;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2202 default:
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2203 if ( uMessageParam != 5 )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2204 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2205 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2206 GameUI_SetFooterString(pTmpBuf.data());
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2207 continue;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2208 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2209 v69 = pMapStats->pInfos[8].pName;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2210 break;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2211 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2212 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2213 else
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2214 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2215 v69 = pMapStats->pInfos[21].pName;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2216 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2217 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2218 GameUI_SetFooterString(pTmpBuf.data());
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2219 continue;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2220 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2221 v68 = 210;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2222 break;
0
Ritor1
parents:
diff changeset
2223 }
Ritor1
parents:
diff changeset
2224 }
Ritor1
parents:
diff changeset
2225 else
Ritor1
parents:
diff changeset
2226 {
Ritor1
parents:
diff changeset
2227 v68 = 206;
Ritor1
parents:
diff changeset
2228 }
484
4bd56919f075 avard quest guild bits
Gloval
parents: 467
diff changeset
2229 if ( !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68) )
0
Ritor1
parents:
diff changeset
2230 {
Ritor1
parents:
diff changeset
2231 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2232 continue;
0
Ritor1
parents:
diff changeset
2233 }
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2234 //LABEL_506:
0
Ritor1
parents:
diff changeset
2235 if ( uMessageParam )
Ritor1
parents:
diff changeset
2236 {
Ritor1
parents:
diff changeset
2237 switch ( uMessageParam )
Ritor1
parents:
diff changeset
2238 {
Ritor1
parents:
diff changeset
2239 case 1:
Ritor1
parents:
diff changeset
2240 v69 = pMapStats->pInfos[4].pName;
Ritor1
parents:
diff changeset
2241 break;
Ritor1
parents:
diff changeset
2242 case 2:
Ritor1
parents:
diff changeset
2243 v69 = pMapStats->pInfos[3].pName;
Ritor1
parents:
diff changeset
2244 break;
Ritor1
parents:
diff changeset
2245 case 3:
Ritor1
parents:
diff changeset
2246 v69 = pMapStats->pInfos[10].pName;
Ritor1
parents:
diff changeset
2247 break;
Ritor1
parents:
diff changeset
2248 case 4:
Ritor1
parents:
diff changeset
2249 v69 = pMapStats->pInfos[7].pName;
Ritor1
parents:
diff changeset
2250 break;
Ritor1
parents:
diff changeset
2251 default:
Ritor1
parents:
diff changeset
2252 if ( uMessageParam != 5 )
Ritor1
parents:
diff changeset
2253 //goto LABEL_519;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2254 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2255 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2256 GameUI_SetFooterString(pTmpBuf.data());
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2257 continue;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2258 }
0
Ritor1
parents:
diff changeset
2259 v69 = pMapStats->pInfos[8].pName;
Ritor1
parents:
diff changeset
2260 break;
Ritor1
parents:
diff changeset
2261 }
Ritor1
parents:
diff changeset
2262 }
Ritor1
parents:
diff changeset
2263 else
Ritor1
parents:
diff changeset
2264 {
Ritor1
parents:
diff changeset
2265 v69 = pMapStats->pInfos[21].pName;
Ritor1
parents:
diff changeset
2266 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2267 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2268 GameUI_SetFooterString(pTmpBuf.data());
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2269 continue;
0
Ritor1
parents:
diff changeset
2270 case UIMSG_ShowFinalWindow:
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2271 sprintf(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
0
Ritor1
parents:
diff changeset
2272 pGlobalTXT_LocalizationStrings[118],// "We hope that you've enjoyed playing Might and Magic VII as much as we did making it. We have saved this screen as MM7_WIN.PCX in your MM7 directory. You can print it out as proof of your accomplishment."
Ritor1
parents:
diff changeset
2273 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team."
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2274 ModalWindow(pFinalMessage.data(), 196);
0
Ritor1
parents:
diff changeset
2275 uGameState = GAME_STATE_FINAL_WINDOW;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2276 continue;
0
Ritor1
parents:
diff changeset
2277 case UIMSG_C4:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
2278 __debugbreak();
982
08fd1436ef35 enums & lod
Nomad
parents: 980
diff changeset
2279 uGameState = GAME_STATE_PLAYING;
0
Ritor1
parents:
diff changeset
2280 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2281 case UIMSG_DD:
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2282 __debugbreak();
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2283 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer);
703
a9c1fb7483c2 monster parser almost complete.
Gloval
parents: 701
diff changeset
2284 memcpy(&v216, txt_file_frametable_parser((const char *)pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 697
diff changeset
2285 if ( v216.uPropCount == 1 )
0
Ritor1
parents:
diff changeset
2286 {
837
bebc19f3d2af Save/load work with some problems
Gloval
parents: 821
diff changeset
2287 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2);
0
Ritor1
parents:
diff changeset
2288 v70 = atoi(v216.pProperties[0]);
Ritor1
parents:
diff changeset
2289 if ( v70 <= 0 || v70 >= 77 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2290 continue;
0
Ritor1
parents:
diff changeset
2291 v71 = v70;
Ritor1
parents:
diff changeset
2292 strcpy(Str2, pMapStats->pInfos[v70].pFilename);
Ritor1
parents:
diff changeset
2293 pNPCData3 = 0;
Ritor1
parents:
diff changeset
2294 if ( (signed int)pNPCData4 > 0 )
Ritor1
parents:
diff changeset
2295 {
Ritor1
parents:
diff changeset
2296 thish = 0;
Ritor1
parents:
diff changeset
2297 do
Ritor1
parents:
diff changeset
2298 {
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1101
diff changeset
2299 if ( !_stricmp((const char *)&pGames_LOD->pSubIndices[thish], Str2) )
0
Ritor1
parents:
diff changeset
2300 break;
Ritor1
parents:
diff changeset
2301 ++thish;
Ritor1
parents:
diff changeset
2302 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1);
Ritor1
parents:
diff changeset
2303 }
Ritor1
parents:
diff changeset
2304 while ( (signed int)pNPCData3 < (signed int)pNPCData4 );
Ritor1
parents:
diff changeset
2305 if ( (signed int)pNPCData3 < (signed int)pNPCData4 )
Ritor1
parents:
diff changeset
2306 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2307 strcpy(pCurrentMapName.data(), (const char *)&pGames_LOD->pSubIndices[(int)pNPCData3]);
0
Ritor1
parents:
diff changeset
2308 dword_6BE364_game_settings_1 |= 1u;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2309 uGameState = GAME_STATE_2;
0
Ritor1
parents:
diff changeset
2310 OnMapLeave();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2311 continue;
0
Ritor1
parents:
diff changeset
2312 }
Ritor1
parents:
diff changeset
2313 }
Ritor1
parents:
diff changeset
2314 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName);
Ritor1
parents:
diff changeset
2315 v73 = Str2;
Ritor1
parents:
diff changeset
2316 }
Ritor1
parents:
diff changeset
2317 else
Ritor1
parents:
diff changeset
2318 {
701
d5b16a44d9b3 frame_table parser, new files for UI func
Gloval
parents: 697
diff changeset
2319 if ( v216.uPropCount != 3 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2320 continue;
0
Ritor1
parents:
diff changeset
2321 v74 = atoi(v216.pProperties[0]);
Ritor1
parents:
diff changeset
2322 thisi = atoi(v216.pProperties[1]);
Ritor1
parents:
diff changeset
2323 v75 = atoi(v216.pProperties[2]);
Ritor1
parents:
diff changeset
2324 v76 = v75;
Ritor1
parents:
diff changeset
2325 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
2326 {
Ritor1
parents:
diff changeset
2327 if ( pIndoor->GetSector(v74, thisi, v75) )
Ritor1
parents:
diff changeset
2328 {
Ritor1
parents:
diff changeset
2329 v77 = thisi;
Ritor1
parents:
diff changeset
2330 pParty->vPosition.x = v74;
Ritor1
parents:
diff changeset
2331 pParty->vPosition.y = v77;
Ritor1
parents:
diff changeset
2332 pParty->vPosition.z = v76;
Ritor1
parents:
diff changeset
2333 pParty->uFallStartY = v76;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2334 continue;
0
Ritor1
parents:
diff changeset
2335 }
Ritor1
parents:
diff changeset
2336 }
Ritor1
parents:
diff changeset
2337 else
Ritor1
parents:
diff changeset
2338 {
Ritor1
parents:
diff changeset
2339 if ( v74 > -32768 )
Ritor1
parents:
diff changeset
2340 {
Ritor1
parents:
diff changeset
2341 if ( v74 < 32768 )
Ritor1
parents:
diff changeset
2342 {
Ritor1
parents:
diff changeset
2343 v77 = thisi;
Ritor1
parents:
diff changeset
2344 if ( thisi > -32768 )
Ritor1
parents:
diff changeset
2345 {
Ritor1
parents:
diff changeset
2346 if ( thisi < 32768 && v76 >= 0 && v76 < 10000 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2347 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2348 pParty->vPosition.x = v74;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2349 pParty->vPosition.y = v77;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2350 pParty->vPosition.z = v76;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2351 pParty->uFallStartY = v76;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2352 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2353 }
0
Ritor1
parents:
diff changeset
2354 }
Ritor1
parents:
diff changeset
2355 }
Ritor1
parents:
diff changeset
2356 }
Ritor1
parents:
diff changeset
2357 }
Ritor1
parents:
diff changeset
2358 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
2359 v73 = "Can't jump to that location!";
Ritor1
parents:
diff changeset
2360 }
Ritor1
parents:
diff changeset
2361 ShowStatusBarString(v73, 6u);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2362 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2363 case UIMSG_CastQuickSpell:
0
Ritor1
parents:
diff changeset
2364 if ( bUnderwater == 1 )
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2365 {
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2366 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2367 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2368 continue;
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2369 }
0
Ritor1
parents:
diff changeset
2370 if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2371 continue;
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2372 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2373 continue;
1000
Ritor1
parents: 999
diff changeset
2374 case UIMSG_CastSpell_Monster_Improvement:
Ritor1
parents: 999
diff changeset
2375 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm,
0
Ritor1
parents:
diff changeset
2376 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
2377 {
Ritor1
parents:
diff changeset
2378 v81 = pGame->pVisInstance->get_picked_object_zbuf_val();
Ritor1
parents:
diff changeset
2379 }
Ritor1
parents:
diff changeset
2380 else
Ritor1
parents:
diff changeset
2381 {
Ritor1
parents:
diff changeset
2382 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206);
Ritor1
parents:
diff changeset
2383 pPoint2 = pMouse->GetCursorPos(&v201);
Ritor1
parents:
diff changeset
2384 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]];
Ritor1
parents:
diff changeset
2385 }
Ritor1
parents:
diff changeset
2386 v83 = v81;
Ritor1
parents:
diff changeset
2387 v44 = (unsigned __int16)v81;
Ritor1
parents:
diff changeset
2388 v84 = v83 >> 16;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
2389 if ( PID_TYPE(v44) != 3 || v84 >= 5120 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2390 continue;
1000
Ritor1
parents: 999
diff changeset
2391 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C;
Ritor1
parents: 999
diff changeset
2392 if ( uMessage == UIMSG_CastSpell_Shoot_Monster )
Ritor1
parents: 999
diff changeset
2393 {
Ritor1
parents: 999
diff changeset
2394 LOBYTE(pSpellInfo->field_8) &= 0xF7;
0
Ritor1
parents:
diff changeset
2395 }
Ritor1
parents:
diff changeset
2396 else
Ritor1
parents:
diff changeset
2397 {
1000
Ritor1
parents: 999
diff changeset
2398 if ( uMessage == UIMSG_CastSpell_Monster_Improvement )
Ritor1
parents: 999
diff changeset
2399 HIBYTE(pSpellInfo->field_8) &= 0xFEu;
0
Ritor1
parents:
diff changeset
2400 else
1000
Ritor1
parents: 999
diff changeset
2401 HIBYTE(pSpellInfo->field_8) &= 0xFDu;
Ritor1
parents: 999
diff changeset
2402 }
Ritor1
parents: 999
diff changeset
2403 pSpellInfo->uPlayerID_2 = uMessageParam;
Ritor1
parents: 999
diff changeset
2404 pSpellInfo->spell_target_pid = v44;
Ritor1
parents: 999
diff changeset
2405 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
Ritor1
parents: 999
diff changeset
2406 pGUIWindow_Settings->Release();
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2407 pGUIWindow_Settings = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2408 pMouse->SetCursorBitmap("MICON1");
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
2409 GameUI_Footer_TimeLeft = 0;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2410 unk_50C9A0 = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2411 back_to_game();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2412 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2413 case UIMSG_1C:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
2414 __debugbreak();
0
Ritor1
parents:
diff changeset
2415 if ( !uActiveCharacter || pCurrentScreen )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2416 continue;
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
2417 ptr_507BC8 = GUIWindow::Create(0, 0, 640, 480, WINDOW_68, uMessageParam, 0);
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2418 pCurrentScreen = SCREEN_19;
0
Ritor1
parents:
diff changeset
2419 pEventTimer->Pause();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2420 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2421 case UIMSG_1B:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
2422 __debugbreak();
0
Ritor1
parents:
diff changeset
2423 if ( !uActiveCharacter )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2424 continue;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2425 if ( pParty->bTurnBasedModeOn != 1 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2426 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2427 if ( pActors[uMessageParam].uAIState == 5 )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2428 stru_50C198.LootActor(&pActors[uMessageParam]);
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2429 else
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2430 Actor::StealFrom(uMessageParam);
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2431 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2432 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2433 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2434 continue;
0
Ritor1
parents:
diff changeset
2435 if ( !(pTurnEngine->field_18 & 2) )
Ritor1
parents:
diff changeset
2436 {
Ritor1
parents:
diff changeset
2437 if ( pActors[uMessageParam].uAIState == 5 )
Ritor1
parents:
diff changeset
2438 stru_50C198.LootActor(&pActors[uMessageParam]);
Ritor1
parents:
diff changeset
2439 else
Ritor1
parents:
diff changeset
2440 Actor::StealFrom(uMessageParam);
Ritor1
parents:
diff changeset
2441 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2442 continue;
271
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 264
diff changeset
2443
1f0af5cac2dd _42ECB5_PlayerAttacksActor
Nomad
parents: 264
diff changeset
2444 case UIMSG_Attack:
0
Ritor1
parents:
diff changeset
2445 if ( !uActiveCharacter )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2446 continue;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2447 if ( pParty->bTurnBasedModeOn != 1 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2448 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2449 _42ECB5_PlayerAttacksActor();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2450 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2451 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2452 if ( pTurnEngine->field_4 == 1 || pTurnEngine->field_4 == 3 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2453 continue;
0
Ritor1
parents:
diff changeset
2454 if ( !(pTurnEngine->field_18 & 2) )
Ritor1
parents:
diff changeset
2455 _42ECB5_PlayerAttacksActor();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2456 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2457 case UIMSG_ExitRest:
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
2458 GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest"
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2459 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2460 case UIMSG_Wait5Minutes:
0
Ritor1
parents:
diff changeset
2461 if ( dword_506F14 == 2 )
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2462 {
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2463 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2464 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2465 continue;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2466 }
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2467 GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2,
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
2468 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2469 dword_506F14 = 1;
0
Ritor1
parents:
diff changeset
2470 _506F18_num_hours_to_sleep = 5;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2471 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2472 case UIMSG_Wait1Hour:
0
Ritor1
parents:
diff changeset
2473 if ( dword_506F14 == 2 )
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2474 {
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2475 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2476 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2477 continue;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2478 }
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2479 GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2,
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
2480 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2481 dword_506F14 = 1;
0
Ritor1
parents:
diff changeset
2482 _506F18_num_hours_to_sleep = 60;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2483 continue;
907
f3ccfc765502 RentRoom
Ritor1
parents: 899
diff changeset
2484 case UIMSG_RentRoom:
0
Ritor1
parents:
diff changeset
2485 dword_506F14 = 2;
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
2486 RestUI_Load();
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 735
diff changeset
2487 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute;
0
Ritor1
parents:
diff changeset
2488 _506F18_num_hours_to_sleep = v86;
Ritor1
parents:
diff changeset
2489 if ( uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116 )
Ritor1
parents:
diff changeset
2490 _506F18_num_hours_to_sleep = v86 + 720;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2491 dword_506F14 = 2;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2492 pParty->RestAndHeal();
766
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2493 pParty->days_played_without_rest = 0;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2494 pParty->pPlayers[3].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2495 pParty->pPlayers[2].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2496 pParty->pPlayers[1].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2497 pParty->pPlayers[0].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2498 continue;
907
f3ccfc765502 RentRoom
Ritor1
parents: 899
diff changeset
2499 case UIMSG_RestWindow:
0
Ritor1
parents:
diff changeset
2500 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
2501 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
2502 if ( pCurrentScreen )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2503 continue;
0
Ritor1
parents:
diff changeset
2504 if ( sub_42F4DA() )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2505 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2506 if ( pParty->bTurnBasedModeOn == 1 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2507 {
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2508 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2509 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2510 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2511 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2512 if ( pParty->uFlags & 0x88 )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2513 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2514 ShowStatusBarString(v88, 2);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2515 if ( !uActiveCharacter )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2516 continue;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2517 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2518 continue;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2519 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2520 if ( pParty->bTurnBasedModeOn == 1 )
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2521 {
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2522 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2523 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2524 }
0
Ritor1
parents:
diff changeset
2525 if ( !(pParty->uFlags & 0x88) )
Ritor1
parents:
diff changeset
2526 {
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
2527 RestUI_Load();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2528 continue;
0
Ritor1
parents:
diff changeset
2529 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2530 if ( pParty->bTurnBasedModeOn == 1 )
0
Ritor1
parents:
diff changeset
2531 {
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2532 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2533 continue;
0
Ritor1
parents:
diff changeset
2534 }
Ritor1
parents:
diff changeset
2535 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
Ritor1
parents:
diff changeset
2536 if ( pParty->uFlags & 0x88 )
Ritor1
parents:
diff changeset
2537 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
Ritor1
parents:
diff changeset
2538 ShowStatusBarString(v88, 2u);
Ritor1
parents:
diff changeset
2539 if ( !uActiveCharacter )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2540 continue;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2541 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2542 continue;
907
f3ccfc765502 RentRoom
Ritor1
parents: 899
diff changeset
2543 case UIMSG_Rest8Hour:
0
Ritor1
parents:
diff changeset
2544 if ( dword_506F14 )
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2545 {
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2546 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2547 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2548 continue;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2549 }
0
Ritor1
parents:
diff changeset
2550 if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest )
Ritor1
parents:
diff changeset
2551 {
Ritor1
parents:
diff changeset
2552 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2u);// "You don't have enough food to rest"
Ritor1
parents:
diff changeset
2553 if ( uActiveCharacter && pPlayers[uActiveCharacter]->CanAct() )
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2554 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_108, 0);
0
Ritor1
parents:
diff changeset
2555 }
Ritor1
parents:
diff changeset
2556 else
Ritor1
parents:
diff changeset
2557 {
Ritor1
parents:
diff changeset
2558 pParty->pPlayers[3].pConditions[2] = pParty->uTimePlayed;
Ritor1
parents:
diff changeset
2559 pParty->pPlayers[2].pConditions[2] = pParty->uTimePlayed;
Ritor1
parents:
diff changeset
2560 pParty->pPlayers[1].pConditions[2] = pParty->uTimePlayed;
Ritor1
parents:
diff changeset
2561 pParty->pPlayers[0].pConditions[2] = pParty->uTimePlayed;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2562 v90 = pMapStats->GetMapInfo(pCurrentMapName.data());
0
Ritor1
parents:
diff changeset
2563 if ( !v90 )
Ritor1
parents:
diff changeset
2564 v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
Ritor1
parents:
diff changeset
2565 pMapInfo = &pMapStats->pInfos[v90];
237
2799737f8a74 more text parsers refactor
Gloval
parents: 234
diff changeset
2566 if ( rand() % 100 + 1 <= pMapInfo->Encounter_percent )
0
Ritor1
parents:
diff changeset
2567 {
Ritor1
parents:
diff changeset
2568 v91 = rand() % 100;
237
2799737f8a74 more text parsers refactor
Gloval
parents: 234
diff changeset
2569 v92 = pMapInfo->EncM1percent;
0
Ritor1
parents:
diff changeset
2570 v93 = v91 + 1;
Ritor1
parents:
diff changeset
2571 if ( v93 > v92 )
237
2799737f8a74 more text parsers refactor
Gloval
parents: 234
diff changeset
2572 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2);
0
Ritor1
parents:
diff changeset
2573 else
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2574 pNPCData4 = (NPCData *)1;
0
Ritor1
parents:
diff changeset
2575 if ( !sub_45063B(pMapInfo, (int)pNPCData4) )
Ritor1
parents:
diff changeset
2576 pNPCData4 = 0;
Ritor1
parents:
diff changeset
2577 if ( pNPCData4 )
Ritor1
parents:
diff changeset
2578 {
Ritor1
parents:
diff changeset
2579 pPlayerNum = rand() % 4;
Ritor1
parents:
diff changeset
2580 LODWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0;
Ritor1
parents:
diff changeset
2581 HIDWORD(pParty->pPlayers[pPlayerNum].pConditions[2]) = 0;
Ritor1
parents:
diff changeset
2582 v95 = rand();
Ritor1
parents:
diff changeset
2583 Rest(v95 % 6 + 60);
Ritor1
parents:
diff changeset
2584 _506F18_num_hours_to_sleep = 0;
Ritor1
parents:
diff changeset
2585 dword_506F14 = 0;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2586 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0
Ritor1
parents:
diff changeset
2587 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2588 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
0
Ritor1
parents:
diff changeset
2589 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
Ritor1
parents:
diff changeset
2590 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
2591 ++pMessageQueue_50CBD0->uNumMessages;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2592 }*/
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2593 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2594 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!"
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2595 pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2596 continue;
0
Ritor1
parents:
diff changeset
2597 }
Ritor1
parents:
diff changeset
2598 }
Ritor1
parents:
diff changeset
2599 Party::TakeFood(uRestUI_FoodRequiredToRest);
Ritor1
parents:
diff changeset
2600 _506F18_num_hours_to_sleep = 480;
Ritor1
parents:
diff changeset
2601 dword_506F14 = 2;
Ritor1
parents:
diff changeset
2602 pParty->RestAndHeal();
766
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2603 pParty->days_played_without_rest = 0;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2604 pParty->pPlayers[3].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2605 pParty->pPlayers[2].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2606 pParty->pPlayers[1].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
a464d28566a6 days_played_without_rest
Nomad
parents: 762
diff changeset
2607 pParty->pPlayers[0].pConditions[Player::Condition_Sleep] = pParty->uTimePlayed;
0
Ritor1
parents:
diff changeset
2608 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2609 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2610 case UIMSG_AlreadyResting:
0
Ritor1
parents:
diff changeset
2611 if ( dword_506F14 == 2 )
Ritor1
parents:
diff changeset
2612 {
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2613 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2614 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2615 continue;
0
Ritor1
parents:
diff changeset
2616 }
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2617 GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2,
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
2618 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
758
9f7db515a8d7 Training Hall & levelling up fixed
Nomad
parents: 735
diff changeset
2619 v97 = _494820_training_time(pParty->uCurrentHour);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2620 dword_506F14 = 1;
0
Ritor1
parents:
diff changeset
2621 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2622 continue;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2623 case UIMSG_HintSelectRemoveQuickSpellBtn:
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2624 if ( quick_spell_at_page && byte_506550 )
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2625 {
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2626 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2627 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173);
0
Ritor1
parents:
diff changeset
2628 }
Ritor1
parents:
diff changeset
2629 else
Ritor1
parents:
diff changeset
2630 {
Ritor1
parents:
diff changeset
2631 if ( pPlayers[uActiveCharacter]->uQuickSpell )
Ritor1
parents:
diff changeset
2632 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell"
Ritor1
parents:
diff changeset
2633 else
Ritor1
parents:
diff changeset
2634 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell"
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2635 strcpy(pTmpBuf.data(), v177);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2636 }
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2637 GameUI_SetFooterString(pTmpBuf.data());
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2638 continue;
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 365
diff changeset
2639 case UIMSG_SPellbook_ShowHightlightedSpellInfo:
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2640 if ( !uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
0
Ritor1
parents:
diff changeset
2641 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)) )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2642 continue;
0
Ritor1
parents:
diff changeset
2643 if ( sub_4637E0_is_there_popup_onscreen() )
Ritor1
parents:
diff changeset
2644 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1;
Ritor1
parents:
diff changeset
2645 v98 = *(char *)(uNumSeconds + 6734);
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2646 if ( quick_spell_at_page - 1 == uMessageParam )
0
Ritor1
parents:
diff changeset
2647 {
Ritor1
parents:
diff changeset
2648 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
Ritor1
parents:
diff changeset
2649 v161 = pGlobalTXT_LocalizationStrings[485];
Ritor1
parents:
diff changeset
2650 }
Ritor1
parents:
diff changeset
2651 else
Ritor1
parents:
diff changeset
2652 {
Ritor1
parents:
diff changeset
2653 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
Ritor1
parents:
diff changeset
2654 v161 = pGlobalTXT_LocalizationStrings[486];
Ritor1
parents:
diff changeset
2655 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2656 sprintfex(pTmpBuf.data(), v161, v178);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
2657 GameUI_SetFooterString(pTmpBuf.data());
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2658 continue;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2659 case UIMSG_ClickInstallRemoveQuickSpellBtn:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2660 GUIWindow::Create(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, WINDOW_PressedButton2, (int)pBtn_InstallRemoveSpell, 0);
0
Ritor1
parents:
diff changeset
2661 if ( !uActiveCharacter )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2662 continue;
0
Ritor1
parents:
diff changeset
2663 pPlayer10 = pPlayers[uActiveCharacter];
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2664 if ( !byte_506550 || !quick_spell_at_page )
0
Ritor1
parents:
diff changeset
2665 {
Ritor1
parents:
diff changeset
2666 pPlayer10->uQuickSpell = 0;
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2667 quick_spell_at_page = 0;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2668 pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2669 continue;
0
Ritor1
parents:
diff changeset
2670 }
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2671 v99 = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage;
0
Ritor1
parents:
diff changeset
2672 pPlayers[uActiveCharacter]->uQuickSpell = v99;
Ritor1
parents:
diff changeset
2673 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter);
Ritor1
parents:
diff changeset
2674 if ( uActiveCharacter )
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
2675 pPlayer10->PlaySound(SPEECH_12, 0);
0
Ritor1
parents:
diff changeset
2676 byte_506550 = 0;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2677 continue;
1118
ca415f6bac1c UIMSG_SpellBook_PressTab
zipi
parents: 1110
diff changeset
2678 case UIMSG_SpellBook_PressTab:
ca415f6bac1c UIMSG_SpellBook_PressTab
zipi
parents: 1110
diff changeset
2679 //__debugbreak();
0
Ritor1
parents:
diff changeset
2680 if ( !uActiveCharacter )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2681 continue;
0
Ritor1
parents:
diff changeset
2682 pPlayer3 = pPlayers[uActiveCharacter];
Ritor1
parents:
diff changeset
2683 pNPCData4 = 0;
Ritor1
parents:
diff changeset
2684 uAction = 0;
Ritor1
parents:
diff changeset
2685 v101 = 0;
Ritor1
parents:
diff changeset
2686 thisl = (int)&pPlayer3->pActiveSkills[12];
Ritor1
parents:
diff changeset
2687 do
Ritor1
parents:
diff changeset
2688 {
Ritor1
parents:
diff changeset
2689 if ( *(short *)thisl )
Ritor1
parents:
diff changeset
2690 {
198
e6e348d66a75 Some work on spellbook
Nomad
parents: 191
diff changeset
2691 if ( pPlayer3->lastOpenedSpellbookPage == v101 )
0
Ritor1
parents:
diff changeset
2692 uAction = (int)pNPCData4;
Ritor1
parents:
diff changeset
2693 v102 = (int)pNPCData4;
Ritor1
parents:
diff changeset
2694 pNPCData4 = (NPCData *)((char *)pNPCData4 + 1);
Ritor1
parents:
diff changeset
2695 v217[v102] = v101;
Ritor1
parents:
diff changeset
2696 }
Ritor1
parents:
diff changeset
2697 thisl += 2;
Ritor1
parents:
diff changeset
2698 ++v101;
Ritor1
parents:
diff changeset
2699 }
Ritor1
parents:
diff changeset
2700 while ( v101 < 9 );
Ritor1
parents:
diff changeset
2701 if ( !pNPCData4 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2702 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2703 v127 = rand() % 2 + 204;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2704 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2705 continue;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2706 }
0
Ritor1
parents:
diff changeset
2707 if ( GetAsyncKeyState(16) )
Ritor1
parents:
diff changeset
2708 {
Ritor1
parents:
diff changeset
2709 --uAction;
Ritor1
parents:
diff changeset
2710 if ( uAction < 0 )
Ritor1
parents:
diff changeset
2711 uAction = (int)((char *)pNPCData4 - 1);
Ritor1
parents:
diff changeset
2712 }
Ritor1
parents:
diff changeset
2713 else
Ritor1
parents:
diff changeset
2714 {
Ritor1
parents:
diff changeset
2715 ++uAction;
Ritor1
parents:
diff changeset
2716 if ( uAction >= (signed int)pNPCData4 )
Ritor1
parents:
diff changeset
2717 uAction = 0;
Ritor1
parents:
diff changeset
2718 }
Ritor1
parents:
diff changeset
2719 sub_41140B();
198
e6e348d66a75 Some work on spellbook
Nomad
parents: 191
diff changeset
2720 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2721 pGUIWindow_CurrentMenu->OpenSpellBook();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2722 v127 = rand() % 2 + 204;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2723 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2724 continue;
832
dfd683c4f538 Hotkeys fixed
Nomad
parents: 828
diff changeset
2725 case UIMSG_OpenSpellbookPage:
198
e6e348d66a75 Some work on spellbook
Nomad
parents: 191
diff changeset
2726 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2727 continue;
0
Ritor1
parents:
diff changeset
2728 sub_41140B();
198
e6e348d66a75 Some work on spellbook
Nomad
parents: 191
diff changeset
2729 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2730 pGUIWindow_CurrentMenu->OpenSpellBook();
0
Ritor1
parents:
diff changeset
2731 v127 = rand() % 2 + 204;
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2732 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2733 continue;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2734 case UIMSG_SelectSpell:
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2735 {
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2736 if (pTurnEngine->field_4 == 3)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2737 continue;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2738 if (!uActiveCharacter)
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2739 continue;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2740
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2741 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2742 auto player = pPlayers[uActiveCharacter];
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2743 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam])
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2744 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) )
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2745 {
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2746 if ( quick_spell_at_page - 1 == uMessageParam )
0
Ritor1
parents:
diff changeset
2747 {
Ritor1
parents:
diff changeset
2748 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
2749 pEventTimer->Resume();
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2750 viewparams->bRedrawGameUI = 1;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2751 pCurrentScreen = SCREEN_GAME;
0
Ritor1
parents:
diff changeset
2752 pIcons_LOD->_4114F2();
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2753 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage;
1000
Ritor1
parents: 999
diff changeset
2754 /*if ( dword_50C9E8 < 40 )
0
Ritor1
parents:
diff changeset
2755 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2756 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2757 dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2758 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
0
Ritor1
parents:
diff changeset
2759 ++dword_50C9E8;
1000
Ritor1
parents: 999
diff changeset
2760 }*/
1012
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
2761 pMessageQueue_50C9E8->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
2762 // pMessageQueue_50CBD0->AddMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
0
Ritor1
parents:
diff changeset
2763 }
Ritor1
parents:
diff changeset
2764 else
Ritor1
parents:
diff changeset
2765 {
Ritor1
parents:
diff changeset
2766 byte_506550 = 1;
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
2767 quick_spell_at_page = uMessageParam + 1;
0
Ritor1
parents:
diff changeset
2768 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2769 }
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2770 }
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2771 continue;
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 365
diff changeset
2772
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 365
diff changeset
2773 case UIMSG_CastSpellFromBook:
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 365
diff changeset
2774 if ( pTurnEngine->field_4 != 3 )
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 365
diff changeset
2775 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0);
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 365
diff changeset
2776 continue;
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 365
diff changeset
2777
1019
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
2778 case UIMSG_SpellScrollUse:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
2779 __debugbreak();
0
Ritor1
parents:
diff changeset
2780 if ( pTurnEngine->field_4 != 3 )
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2781 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2782 continue;
907
f3ccfc765502 RentRoom
Ritor1
parents: 899
diff changeset
2783 case UIMSG_SpellBookWindow:
0
Ritor1
parents:
diff changeset
2784 if ( pTurnEngine->field_4 == 3 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2785 continue;
0
Ritor1
parents:
diff changeset
2786 if ( bUnderwater == 1 )
Ritor1
parents:
diff changeset
2787 {
362
38bfbee60146 Menu options
Ritor1
parents: 359
diff changeset
2788 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2789 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
0
Ritor1
parents:
diff changeset
2790 }
Ritor1
parents:
diff changeset
2791 else
Ritor1
parents:
diff changeset
2792 {
Ritor1
parents:
diff changeset
2793 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
2794 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
2795 if ( uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery )
Ritor1
parents:
diff changeset
2796 {
Ritor1
parents:
diff changeset
2797 if ( !pCurrentScreen )
Ritor1
parents:
diff changeset
2798 {
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2799 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2800 pCurrentScreen = SCREEN_SPELL_BOOK;
0
Ritor1
parents:
diff changeset
2801 pEventTimer->Pause();
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
2802 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
0
Ritor1
parents:
diff changeset
2803 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2804 viewparams->field_48 = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2805 continue;
0
Ritor1
parents:
diff changeset
2806 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2807 if ( pCurrentScreen != SCREEN_REST
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2808 && pCurrentScreen != SCREEN_CHARACTERS
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2809 && (pCurrentScreen <= SCREEN_63
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2810 || pCurrentScreen > SCREEN_67) )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2811 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2812 pGUIWindow_CurrentMenu->Release();
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2813 GUIWindow::Create(0x1DCu, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_CastSpell, 0);
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2814 pCurrentScreen = SCREEN_SPELL_BOOK;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2815 pEventTimer->Pause();
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
2816 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_SpellBook, 0, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2817 pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2818 viewparams->field_48 = 1;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2819 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2820 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2821 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2822 }
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2823 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2824 case UIMSG_QuickReference:
0
Ritor1
parents:
diff changeset
2825 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
2826 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
2827 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
2828 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
2829 ++pIcons_LOD->uTexturePacksCount;
Ritor1
parents:
diff changeset
2830 if ( !pIcons_LOD->uNumPrevLoadedFiles )
Ritor1
parents:
diff changeset
2831 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2832 GUIWindow::Create(0x230u, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_QuickReference, 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2833 viewparams->bRedrawGameUI = 1;
0
Ritor1
parents:
diff changeset
2834 pEventTimer->Pause();
Ritor1
parents:
diff changeset
2835 pAudioPlayer->StopChannels(-1, -1);
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2836 pCurrentScreen = SCREEN_QUICK_REFERENCE;
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
2837 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_QuickReference, 5, 0);
0
Ritor1
parents:
diff changeset
2838 papredoll_dbrds[2] = pIcons_LOD->LoadTexture("BUTTEXI1", TEXTURE_16BIT_PALETTE);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2839 pBtn_ExitCancel = pGUIWindow_CurrentMenu->CreateButton(0x187u, 0x13Cu, 0x4Bu, 0x21u, 1, 0, UIMSG_Escape, 0, 0,
0
Ritor1
parents:
diff changeset
2840 pGlobalTXT_LocalizationStrings[79],// "Exit"
973
ec7568e13b24 Minor code cleaning.
Nomad
parents: 972
diff changeset
2841 pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0); //, v179);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2842 continue;
358
4a236657a0be GameMenuButton fix
Ritor1
parents: 339
diff changeset
2843 case UIMSG_GameMenuButton:
0
Ritor1
parents:
diff changeset
2844 if ( pCurrentScreen )
Ritor1
parents:
diff changeset
2845 {
Ritor1
parents:
diff changeset
2846 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
2847 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
2848 pCurrentScreen = SCREEN_GAME;
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2849 viewparams->bRedrawGameUI = 1;
0
Ritor1
parents:
diff changeset
2850 }
Ritor1
parents:
diff changeset
2851 stru_506E40.Release();
Ritor1
parents:
diff changeset
2852 uNumSeconds = (unsigned int)MakeScreenshot(155, 117);
Ritor1
parents:
diff changeset
2853 pRenderer->SavePCXImage("gamma.pcx", (char *)uNumSeconds, 155, 117);
Ritor1
parents:
diff changeset
2854 free((void *)uNumSeconds);
Ritor1
parents:
diff changeset
2855 stru_506E40._40E55E("gamma.pcx", 0);
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2856 GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton, (int)pBtn_GameSettings, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2857 //LABEL_453:
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2858 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2859 continue;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2860 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2861 //goto LABEL_770;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2862 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2863 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2864 ++pMessageQueue_50CBD0->uNumMessages;*/
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
2865 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2866 continue;
1101
3e5d70cfe20e Award order fix, changed UIMSG_C0 to UIMSG_ClickAwardScrollBar
Grumpy7
parents: 1091
diff changeset
2867 case UIMSG_ClickAwardScrollBar:
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2868 dword_50651C = 1;
0
Ritor1
parents:
diff changeset
2869 if ( pMouse->GetCursorPos(&v211)->y > 178 )
Ritor1
parents:
diff changeset
2870 dword_50651C = -1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2871 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2872 case UIMSG_ClickAwardsUpBtn:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2873 GUIWindow::Create(pBtn_Up->uX, pBtn_Up->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Up, 0);
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2874 BtnUp_flag = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2875 continue;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
2876 case UIMSG_ClickAwardsDownBtn:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2877 GUIWindow::Create(pBtn_Down->uX, pBtn_Down->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pBtn_Down, 0);
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2878 BtnDown_flag = 1;
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2879 continue;
910
Ritor1
parents: 907
diff changeset
2880 case UIMSG_ChangeDetaliz:
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2881 bRingsShownInCharScreen ^= 1;
910
Ritor1
parents: 907
diff changeset
2882 pCharacterScreen_DetalizBtn->Release();
697
2dfb67633b01 GUIButton Release
zipi
parents: 693
diff changeset
2883 pCharacterScreen_DollBtn->Release();
0
Ritor1
parents:
diff changeset
2884 if ( bRingsShownInCharScreen )
Ritor1
parents:
diff changeset
2885 {
973
ec7568e13b24 Minor code cleaning.
Nomad
parents: 972
diff changeset
2886 v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight;
ec7568e13b24 Minor code cleaning.
Nomad
parents: 972
diff changeset
2887 v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth;
0
Ritor1
parents:
diff changeset
2888 v123 = 445;
Ritor1
parents:
diff changeset
2889 v121 = 470;
Ritor1
parents:
diff changeset
2890 }
Ritor1
parents:
diff changeset
2891 else
Ritor1
parents:
diff changeset
2892 {
Ritor1
parents:
diff changeset
2893 v128 = 30;
Ritor1
parents:
diff changeset
2894 v125 = 30;
Ritor1
parents:
diff changeset
2895 v123 = 300;
Ritor1
parents:
diff changeset
2896 v121 = 600;
Ritor1
parents:
diff changeset
2897 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2898 pCharacterScreen_DetalizBtn = pGUIWindow_CurrentMenu->CreateButton(v121, v123, v125, v128, 1, 0, UIMSG_ChangeDetaliz, 0, 0,
0
Ritor1
parents:
diff changeset
2899 pGlobalTXT_LocalizationStrings[64],// "Detail Toggle"
Ritor1
parents:
diff changeset
2900 0);
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
2901 pCharacterScreen_DollBtn = pGUIWindow_CurrentMenu->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, UIMSG_ClickPaperdoll, 0, 0, "", 0);
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
2902 viewparams->bRedrawGameUI = 1;
910
Ritor1
parents: 907
diff changeset
2903 continue;
Ritor1
parents: 907
diff changeset
2904 case UIMSG_ClickPaperdoll:
0
Ritor1
parents:
diff changeset
2905 OnPaperdollLeftClick();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2906 continue;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2907 case UIMSG_ClickStatsBtn:
0
Ritor1
parents:
diff changeset
2908 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100;
991
c5d8ea1e6ccb CharacterUI cleanings.
Nomad
parents: 984
diff changeset
2909 CharacterUI_ReleaseButtons();
0
Ritor1
parents:
diff changeset
2910 sub_419379();
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2911 GUIWindow::Create(pCharacterScreen_StatsBtn->uX, pCharacterScreen_StatsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_StatsBtn, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2912 continue;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2913 case UIMSG_ClickSkillsBtn:
0
Ritor1
parents:
diff changeset
2914 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 101;
991
c5d8ea1e6ccb CharacterUI cleanings.
Nomad
parents: 984
diff changeset
2915 CharacterUI_ReleaseButtons();
0
Ritor1
parents:
diff changeset
2916 sub_419379();
991
c5d8ea1e6ccb CharacterUI cleanings.
Nomad
parents: 984
diff changeset
2917 CharacterUI_SkillsTab_CreateButtons();
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2918 GUIWindow::Create(pCharacterScreen_SkillsBtn->uX, pCharacterScreen_SkillsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_SkillsBtn, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
2919 continue;
0
Ritor1
parents:
diff changeset
2920 case UIMSG_SkillUp:
Ritor1
parents:
diff changeset
2921 pPlayer4 = pPlayers[uActiveCharacter];
Ritor1
parents:
diff changeset
2922 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
Ritor1
parents:
diff changeset
2923 LOWORD(v2) = *(short *)v105;
Ritor1
parents:
diff changeset
2924 uNumSeconds = v2;
Ritor1
parents:
diff changeset
2925 if ( pPlayer4->uSkillPoints < (v2 & 0x3F) + 1 )
Ritor1
parents:
diff changeset
2926 {
Ritor1
parents:
diff changeset
2927 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!"
Ritor1
parents:
diff changeset
2928 }
Ritor1
parents:
diff changeset
2929 else
Ritor1
parents:
diff changeset
2930 {
Ritor1
parents:
diff changeset
2931 if ( (uNumSeconds & 0x3F) < 0x3C )
Ritor1
parents:
diff changeset
2932 {
Ritor1
parents:
diff changeset
2933 *(short *)v105 = uNumSeconds + 1;
Ritor1
parents:
diff changeset
2934 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F;
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
2935 pPlayer4->PlaySound(SPEECH_14, 0);
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2936 pAudioPlayer->PlaySound((SoundID)20001, 0, 0, -1, 0, 0, 0, 0);
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2937 continue;
0
Ritor1
parents:
diff changeset
2938 }
Ritor1
parents:
diff changeset
2939 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
Ritor1
parents:
diff changeset
2940 }
916
897b10712a1a UIShop_Buy_Identify_Repair little clean and rename
Ritor1
parents: 910
diff changeset
2941 ShowStatusBarString(v87, 2);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2942 continue;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2943 case UIMSG_ClickInventoryBtn:
0
Ritor1
parents:
diff changeset
2944 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103;
Ritor1
parents:
diff changeset
2945 sub_419379();
991
c5d8ea1e6ccb CharacterUI cleanings.
Nomad
parents: 984
diff changeset
2946 CharacterUI_ReleaseButtons();
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2947 GUIWindow::Create(pCharacterScreen_InventoryBtn->uX, pCharacterScreen_InventoryBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_InventoryBtn, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2948 continue;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2949 case UIMSG_ClickExitCharacterWindowBtn:
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2950 GUIWindow::Create(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, WINDOW_ExitCharacterWindow, (int)pCharacterScreen_ExitBtn, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2951 continue;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
2952 case UIMSG_ClickAwardsBtn:
0
Ritor1
parents:
diff changeset
2953 sub_419379();
991
c5d8ea1e6ccb CharacterUI cleanings.
Nomad
parents: 984
diff changeset
2954 CharacterUI_ReleaseButtons();
0
Ritor1
parents:
diff changeset
2955 sub_419220();
Ritor1
parents:
diff changeset
2956 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 102;
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
2957 GUIWindow::Create(pCharacterScreen_AwardsBtn->uX, pCharacterScreen_AwardsBtn->uY, 0, 0, WINDOW_CharactersPressedButton, (int)pCharacterScreen_AwardsBtn, 0);
521
663c4f618f56 Awards tab corrrection
Gloval
parents: 515
diff changeset
2958 FillAwardsData();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2959 continue;
1000
Ritor1
parents: 999
diff changeset
2960 case UIMSG_ClickBooksBtn:
0
Ritor1
parents:
diff changeset
2961 switch ( uMessageParam )
Ritor1
parents:
diff changeset
2962 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2963 case 11://Page UP
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2964 BtnUp_flag = 1;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2965 pButton = pBtn_Book_2;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2966 break;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2967 case 10://Page DOWN
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2968 BtnDown_flag = 1;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2969 pButton = pBtn_Book_1;
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2970 break;
1000
Ritor1
parents: 999
diff changeset
2971 case 0://Zoom plus
0
Ritor1
parents:
diff changeset
2972 pButton = pBtn_Book_1;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2973 BtnDown_flag = 1;
0
Ritor1
parents:
diff changeset
2974 break;
1000
Ritor1
parents: 999
diff changeset
2975 case 1://Zoom minus
Ritor1
parents: 999
diff changeset
2976 pButton = pBtn_Book_2;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2977 BtnUp_flag = 1;
0
Ritor1
parents:
diff changeset
2978 break;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2979 case 2://Potions
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2980 Book_PageBtn3_flag = 1;
0
Ritor1
parents:
diff changeset
2981 if ( dword_506364 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2982 continue;
0
Ritor1
parents:
diff changeset
2983 pButton = pBtn_Book_3;
Ritor1
parents:
diff changeset
2984 break;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2985 case 3://fountains
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2986 Book_PageBtn4_flag = 1;
0
Ritor1
parents:
diff changeset
2987 if ( dword_506364 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2988 continue;
0
Ritor1
parents:
diff changeset
2989 pButton = pBtn_Book_4;
Ritor1
parents:
diff changeset
2990 break;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2991 case 4://obelisks
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2992 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag
0
Ritor1
parents:
diff changeset
2993 if ( dword_506364 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
2994 continue;
0
Ritor1
parents:
diff changeset
2995 pButton = pBtn_Book_5;
Ritor1
parents:
diff changeset
2996 break;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2997 case 5://seer
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
2998 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag
0
Ritor1
parents:
diff changeset
2999 if ( dword_506364 )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3000 continue;
0
Ritor1
parents:
diff changeset
3001 pButton = pBtn_Book_6;
Ritor1
parents:
diff changeset
3002 break;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3003 case 6://misc
0
Ritor1
parents:
diff changeset
3004 pButton = pBtn_Autonotes_Misc;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3005 Autonotes_Misc_page_flag = 1;
0
Ritor1
parents:
diff changeset
3006 break;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3007 case 7://Instructors
0
Ritor1
parents:
diff changeset
3008 pButton = pBtn_Autonotes_Instructors;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3009 Autonotes_Instructors_page_flag = 1;
0
Ritor1
parents:
diff changeset
3010 break;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3011 default:
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3012 continue;
0
Ritor1
parents:
diff changeset
3013 }
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
3014 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3015 continue;
0
Ritor1
parents:
diff changeset
3016 case UIMSG_SelectCharacter:
Ritor1
parents:
diff changeset
3017 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
3018 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
3019 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3020 continue;
0
Ritor1
parents:
diff changeset
3021 case UIMSG_ShowStatus_Funds:
Ritor1
parents:
diff changeset
3022 v174 = (char *)pParty->uNumGoldInBank;
Ritor1
parents:
diff changeset
3023 v158 = pParty->uNumGold + pParty->uNumGoldInBank;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3024 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], v158, v174);// "You have %d total gold, %d in the Bank"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3025 GameUI_SetFooterString(pTmpBuf.data());
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3026 continue;
0
Ritor1
parents:
diff changeset
3027 case UIMSG_ShowStatus_DateTime:
Ritor1
parents:
diff changeset
3028 pNPCData4 = (NPCData *)pParty->uCurrentHour;
Ritor1
parents:
diff changeset
3029 if ( (signed int)pParty->uCurrentHour <= 12 )
Ritor1
parents:
diff changeset
3030 {
Ritor1
parents:
diff changeset
3031 if ( !pNPCData4 )
Ritor1
parents:
diff changeset
3032 pNPCData4 = (NPCData *)12;
Ritor1
parents:
diff changeset
3033 }
Ritor1
parents:
diff changeset
3034 else
Ritor1
parents:
diff changeset
3035 {
Ritor1
parents:
diff changeset
3036 pNPCData4 = (NPCData *)((char *)pNPCData4 - 12);
Ritor1
parents:
diff changeset
3037 }
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
3038 if ( pParty->uCurrentHour < 0xC || (uNumSeconds = 1, pParty->uCurrentHour >= 0x18) )
0
Ritor1
parents:
diff changeset
3039 uNumSeconds = 0;
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3040 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", pNPCData4, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
0
Ritor1
parents:
diff changeset
3041 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3042 GameUI_SetFooterString(pTmpBuf.data());
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3043 continue;
0
Ritor1
parents:
diff changeset
3044 case UIMSG_ShowStatus_Food:
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3045 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3046 GameUI_SetFooterString(pTmpBuf.data());
306
e33f5a1cdc46 Food status
Nomad
parents: 305
diff changeset
3047 continue;
0
Ritor1
parents:
diff changeset
3048 case UIMSG_ShowStatus_Player:
Ritor1
parents:
diff changeset
3049 pPlayer5 = pPlayers[uMessageParam];
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3050 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3051 strcat(pTmpBuf.data(), ": ");
0
Ritor1
parents:
diff changeset
3052 v107 = pPlayer5->GetMajorConditionIdx();
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3053 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3054 GameUI_SetFooterString(pTmpBuf.data());
0
Ritor1
parents:
diff changeset
3055 v108 = 8 * uMessageParam - 8;
Ritor1
parents:
diff changeset
3056 LOBYTE(v108) = v108 | 4;
888
abf7b7d2c8f7 small fixes
zipi
parents: 884
diff changeset
3057 pMouse->uPointingObjectID = PID(OBJECT_Player,v108);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3058 continue;
0
Ritor1
parents:
diff changeset
3059 case UIMSG_ShowStatus_ManaHP:
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3060 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(),
1000
Ritor1
parents: 999
diff changeset
3061 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(),
Ritor1
parents: 999
diff changeset
3062 pGlobalTXT_LocalizationStrings[212]);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
3063 GameUI_SetFooterString(pTmpBuf.data());
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3064 continue;
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3065 case UIMSG_CHEST_ClickItem:
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3066 if ( pCurrentScreen == SCREEN_CHEST_INVENTORY )
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3067 {
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3068 OnInventoryLeftClick();
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3069 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3070 }
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3071 OnChestLeftClick();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3072 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3073 case UIMSG_InventoryLeftClick:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3074 OnInventoryLeftClick();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3075 continue;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3076 case UIMSG_MouseLeftClickInGame:
0
Ritor1
parents:
diff changeset
3077 if ( !pRenderer->pRenderD3D )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3078 {
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3079 if ( pMessageQueue_50CBD0->uNumMessages )
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3080 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3081 OnGameViewportClick();
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3082 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3083 }
0
Ritor1
parents:
diff changeset
3084 v115 = pMessageQueue_50CBD0->uNumMessages;
Ritor1
parents:
diff changeset
3085 if ( !pMessageQueue_50CBD0->uNumMessages )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3086 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3087 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3088 /*if ( (signed int)v115 < 40 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3089 //goto LABEL_769;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3090 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3091 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3092 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3093 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3094 ++pMessageQueue_50CBD0->uNumMessages;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3095 continue;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3096 }*/
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3097 continue;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3098 }
0
Ritor1
parents:
diff changeset
3099 if ( pMessageQueue_50CBD0->pMessages[0].field_8 )
Ritor1
parents:
diff changeset
3100 {
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
3101 pMessageQueue_50CBD0->uNumMessages = 1;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3102 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3103 /*v115 = v0;
0
Ritor1
parents:
diff changeset
3104 pMessageQueue_50CBD0->uNumMessages = v0;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3105 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
0
Ritor1
parents:
diff changeset
3106 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3107 //goto LABEL_771;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3108 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3109 ++pMessageQueue_50CBD0->uNumMessages;*/
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3110 continue;
0
Ritor1
parents:
diff changeset
3111 }
Ritor1
parents:
diff changeset
3112 v115 = 0;
Ritor1
parents:
diff changeset
3113 pMessageQueue_50CBD0->uNumMessages = 0;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3114 pMessageQueue_50CBD0->AddMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3115 /*if ( (signed int)v115 < 40 )
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3116 //goto LABEL_769;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3117 {
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3118 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3119 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3120 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3121 ++pMessageQueue_50CBD0->uNumMessages;
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3122 continue;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3123 }*/
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3124 continue;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3125 case UIMSG_MouseLeftClickInScreen://ñðàáàòûâàåò ïðè íàæàòèè íà ïðàâóþ êíîïêó ìûøè ïîñëå UIMSG_MouseLeftClickInGame
0
Ritor1
parents:
diff changeset
3126 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
3127 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
3128 OnGameViewportClick();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3129 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3130 case UIMSG_F:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3131 __debugbreak();
0
Ritor1
parents:
diff changeset
3132 if ( pRenderer->pRenderD3D )
Ritor1
parents:
diff changeset
3133 {
Ritor1
parents:
diff changeset
3134 LOWORD(v116) = pGame->pVisInstance->get_picked_object_zbuf_val();
Ritor1
parents:
diff changeset
3135 }
Ritor1
parents:
diff changeset
3136 else
Ritor1
parents:
diff changeset
3137 {
Ritor1
parents:
diff changeset
3138 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209);
Ritor1
parents:
diff changeset
3139 pPoint3 = pMouse->GetCursorPos(&v204);
Ritor1
parents:
diff changeset
3140 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]];
Ritor1
parents:
diff changeset
3141 }
Ritor1
parents:
diff changeset
3142 pButton2 = (GUIButton *)(unsigned __int16)v116;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3143 GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0);
11
66319a734368 16.01.13(work)
Ritor1
parents: 4
diff changeset
3144 continue;
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3145 case UIMSG_54:
987
9e132060ada3 UIMSG_CHEST_ClickItem
Ritor1
parents: 984
diff changeset
3146 __debugbreak();
0
Ritor1
parents:
diff changeset
3147 pButton2 = (GUIButton *)uMessageParam;
990
087a9af8e0ec MessageParam
Ritor1
parents: 987
diff changeset
3148 GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0);
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3149 continue;
201
30aa44013f7a On Items
Nomad
parents: 199
diff changeset
3150 case UIMSG_Game_Action:
0
Ritor1
parents:
diff changeset
3151 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
3152 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
Ritor1
parents:
diff changeset
3153 OnPressSpace();
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3154 continue;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3155 case UIMSG_ClickZoomOutBtn:
0
Ritor1
parents:
diff changeset
3156 if ( pCurrentScreen )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3157 continue;
0
Ritor1
parents:
diff changeset
3158 pParty->uFlags |= 2u;
1000
Ritor1
parents: 999
diff changeset
3159 GUIWindow::Create(519, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomOut, 0);
0
Ritor1
parents:
diff changeset
3160 uNumSeconds = 131072;
Ritor1
parents:
diff changeset
3161 v118 = 2 * viewparams->uMinimapZoom;
Ritor1
parents:
diff changeset
3162 ++viewparams->field_28;
Ritor1
parents:
diff changeset
3163 viewparams->uMinimapZoom *= 2;
Ritor1
parents:
diff changeset
3164 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor)
Ritor1
parents:
diff changeset
3165 {
Ritor1
parents:
diff changeset
3166 if ( (signed int)v118 > 4096 )
Ritor1
parents:
diff changeset
3167 {
Ritor1
parents:
diff changeset
3168 viewparams->uMinimapZoom = 4096;
Ritor1
parents:
diff changeset
3169 viewparams->field_28 = 12;
Ritor1
parents:
diff changeset
3170 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3171 continue;
0
Ritor1
parents:
diff changeset
3172 }
Ritor1
parents:
diff changeset
3173 v119 = 2048;
Ritor1
parents:
diff changeset
3174 if ( (signed int)v118 <= 2048 )
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3175 {
1051
05c62d166182 004C1D2B cleaned
Nomad
parents: 1048
diff changeset
3176 _576E2C_current_minimap_zoom = v118;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3177 dword_576E28 = viewparams->field_28;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3178 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3179 }
0
Ritor1
parents:
diff changeset
3180 viewparams->field_28 = 11;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3181 viewparams->uMinimapZoom = v119;
1051
05c62d166182 004C1D2B cleaned
Nomad
parents: 1048
diff changeset
3182 _576E2C_current_minimap_zoom = v119;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3183 dword_576E28 = viewparams->field_28;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3184 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3185 case UIMSG_ClickZoomInBtn:
0
Ritor1
parents:
diff changeset
3186 if ( pCurrentScreen )
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3187 continue;
0
Ritor1
parents:
diff changeset
3188 pParty->uFlags |= 2u;
1000
Ritor1
parents: 999
diff changeset
3189 GUIWindow::Create(574, 136, 0, 0, WINDOW_PressedButton2, (int)pBtn_ZoomIn, 0);
0
Ritor1
parents:
diff changeset
3190 uNumSeconds = 32768;
Ritor1
parents:
diff changeset
3191 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
Ritor1
parents:
diff changeset
3192 --viewparams->field_28;
Ritor1
parents:
diff changeset
3193 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
Ritor1
parents:
diff changeset
3194 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
3195 {
Ritor1
parents:
diff changeset
3196 v119 = 512;
Ritor1
parents:
diff changeset
3197 if ( (signed int)v118 < 512 )
Ritor1
parents:
diff changeset
3198 {
Ritor1
parents:
diff changeset
3199 viewparams->field_28 = 9;
Ritor1
parents:
diff changeset
3200 v118 = v119;
Ritor1
parents:
diff changeset
3201 viewparams->uMinimapZoom = v119;
Ritor1
parents:
diff changeset
3202 }
1051
05c62d166182 004C1D2B cleaned
Nomad
parents: 1048
diff changeset
3203 _576E2C_current_minimap_zoom = v118;
0
Ritor1
parents:
diff changeset
3204 dword_576E28 = viewparams->field_28;
Ritor1
parents:
diff changeset
3205 }
Ritor1
parents:
diff changeset
3206 else
Ritor1
parents:
diff changeset
3207 {
Ritor1
parents:
diff changeset
3208 if ( (signed int)v118 < 256 )
Ritor1
parents:
diff changeset
3209 {
Ritor1
parents:
diff changeset
3210 viewparams->uMinimapZoom = 256;
Ritor1
parents:
diff changeset
3211 viewparams->field_28 = 8;
Ritor1
parents:
diff changeset
3212 }
Ritor1
parents:
diff changeset
3213 }
4
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3214 default:
8e33efd39355 15.01.13(work)
Ritor1
parents: 3
diff changeset
3215 continue;
0
Ritor1
parents:
diff changeset
3216 }
Ritor1
parents:
diff changeset
3217 }
Ritor1
parents:
diff changeset
3218 }
1012
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
3219 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8;
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
3220 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages);
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
3221 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8);
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
3222 //dword_50C9E8 = 0;
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
3223
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
3224
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
3225 pMessageQueue_50C9E8->uNumMessages=0;
0
Ritor1
parents:
diff changeset
3226 if ( dword_50C9DC )
Ritor1
parents:
diff changeset
3227 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3228 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0
Ritor1
parents:
diff changeset
3229 {
Ritor1
parents:
diff changeset
3230 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC;
Ritor1
parents:
diff changeset
3231 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0;
Ritor1
parents:
diff changeset
3232 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
3233 ++pMessageQueue_50CBD0->uNumMessages;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3234 }*/
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3235 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0);
0
Ritor1
parents:
diff changeset
3236 dword_50C9DC = 0;
Ritor1
parents:
diff changeset
3237 }
Ritor1
parents:
diff changeset
3238 else
Ritor1
parents:
diff changeset
3239 {
Ritor1
parents:
diff changeset
3240 if ( dword_50C9D0 > 0 )
Ritor1
parents:
diff changeset
3241 {
Ritor1
parents:
diff changeset
3242 dword_50C9D8 -= pEventTimer->uTimeElapsed;
Ritor1
parents:
diff changeset
3243 if ( dword_50C9D8 <= 0 )
Ritor1
parents:
diff changeset
3244 {
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3245 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
0
Ritor1
parents:
diff changeset
3246 {
Ritor1
parents:
diff changeset
3247 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0;
Ritor1
parents:
diff changeset
3248 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4;
Ritor1
parents:
diff changeset
3249 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
Ritor1
parents:
diff changeset
3250 ++pMessageQueue_50CBD0->uNumMessages;
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3251 }*/
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3252 pMessageQueue_50CBD0->AddMessage((UIMessageType)dword_50C9D0, dword_50C9D4, 0);
0
Ritor1
parents:
diff changeset
3253 dword_50C9D0 = 0;
Ritor1
parents:
diff changeset
3254 dword_50C9D4 = 0;
Ritor1
parents:
diff changeset
3255 dword_50C9D8 = 0;
Ritor1
parents:
diff changeset
3256 }
Ritor1
parents:
diff changeset
3257 }
Ritor1
parents:
diff changeset
3258 }
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1184
diff changeset
3259 pCastSpellInfo.data()->_427E01_cast_spell();
0
Ritor1
parents:
diff changeset
3260 }
Ritor1
parents:
diff changeset
3261
Ritor1
parents:
diff changeset
3262 //----- (004356FF) --------------------------------------------------------
Ritor1
parents:
diff changeset
3263 void __cdecl back_to_game()
Ritor1
parents:
diff changeset
3264 {
Ritor1
parents:
diff changeset
3265 dword_507BF0_is_there_popup_onscreen = 0;
Ritor1
parents:
diff changeset
3266 dword_4E455C = 1;
Ritor1
parents:
diff changeset
3267 dword_50CDCC = 0;
Ritor1
parents:
diff changeset
3268 if ( pGUIWindow_ScrollWindow )
Ritor1
parents:
diff changeset
3269 free_book_subwindow();
Ritor1
parents:
diff changeset
3270 if ( !pCurrentScreen && !pGUIWindow_Settings )
Ritor1
parents:
diff changeset
3271 pEventTimer->Resume();
Ritor1
parents:
diff changeset
3272 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
3273 }
782
c47efaf23642 more tidy
zipi
parents: 766
diff changeset
3274
0
Ritor1
parents:
diff changeset
3275 //----- (00435748) --------------------------------------------------------
Ritor1
parents:
diff changeset
3276 void __cdecl GUI_MainMenuMessageProc()
Ritor1
parents:
diff changeset
3277 {
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3278 Player *pPlayer; // ebx@2
0
Ritor1
parents:
diff changeset
3279 void *v3; // edi@21
Ritor1
parents:
diff changeset
3280 signed int v4; // eax@29
Ritor1
parents:
diff changeset
3281 int v5; // ecx@29
821
5e3f4bf3b8e6 * UpdateActorAI clean
zipi
parents: 819
diff changeset
3282 PLAYER_SKILL_TYPE v6; // edi@37
0
Ritor1
parents:
diff changeset
3283 GUIWindow *pWindow; // eax@56
Ritor1
parents:
diff changeset
3284 GUIButton *pButton; // eax@59
Ritor1
parents:
diff changeset
3285 int v15; // edi@70
Ritor1
parents:
diff changeset
3286 char v20; // dl@116
Ritor1
parents:
diff changeset
3287 unsigned int v21; // eax@116
Ritor1
parents:
diff changeset
3288 unsigned int v25; // eax@120
Ritor1
parents:
diff changeset
3289 unsigned int v26; // ecx@127
Ritor1
parents:
diff changeset
3290 SoundID pSoundID; // [sp-2Ch] [bp-3Ch]@36
Ritor1
parents:
diff changeset
3291 signed int v41; // [sp-10h] [bp-20h]@29
971
Ritor1
parents: 970
diff changeset
3292 int pParam; // [sp+4h] [bp-Ch]@3
0
Ritor1
parents:
diff changeset
3293 UIMessageType pUIMessageType; // [sp+8h] [bp-8h]@3
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3294 int pSex; // [sp+Ch] [bp-4h]@3
0
Ritor1
parents:
diff changeset
3295
Ritor1
parents:
diff changeset
3296 if ( pMessageQueue_50CBD0->uNumMessages )
Ritor1
parents:
diff changeset
3297 {
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3298 pPlayer = pParty->pPlayers;
0
Ritor1
parents:
diff changeset
3299 do
Ritor1
parents:
diff changeset
3300 {
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
3301 int param2;
971
Ritor1
parents: 970
diff changeset
3302 pMessageQueue_50CBD0->PopMessage(&pUIMessageType, &pParam, &param2);
Ritor1
parents: 970
diff changeset
3303 auto player = &pParty->pPlayers[pParam];
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
3304
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3305 switch (pUIMessageType) // For buttons of window MainMenu
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3306 {
165
Ritor1
parents: 163
diff changeset
3307 case UIMSG_MainMenu_ShowPartyCreationWnd:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3308 GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
0
Ritor1
parents:
diff changeset
3309 SetCurrentMenuID(MENU_NEWGAME);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3310 break;
165
Ritor1
parents: 163
diff changeset
3311 case UIMSG_MainMenu_ShowLoadWindow:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3312 GUIWindow::Create(495, 227, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnLoad, 0);
0
Ritor1
parents:
diff changeset
3313 SetCurrentMenuID(MENU_SAVELOAD);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3314 break;
165
Ritor1
parents: 163
diff changeset
3315 case UIMSG_ShowCredits:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3316 GUIWindow::Create(495, 282, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnCredits, 0);
0
Ritor1
parents:
diff changeset
3317 SetCurrentMenuID(MENU_CREDITS);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3318 break;
165
Ritor1
parents: 163
diff changeset
3319 case UIMSG_ExitToWindows:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3320 GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
982
08fd1436ef35 enums & lod
Nomad
parents: 980
diff changeset
3321 SetCurrentMenuID(MENU_EXIT_GAME);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3322 break;
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
3323 case UIMSG_PlayerCreation_SelectAttribute:
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3324 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
971
Ritor1
parents: 970
diff changeset
3325 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
Ritor1
parents: 970
diff changeset
3326 uPlayerCreationUI_SelectedCharacter = pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3327 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3328 break;
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
3329 case UIMSG_PlayerCreation_VoicePrev:
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3330 pSex = player->GetSexByVoice();
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3331 do
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3332 {
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3333 if (player->uVoiceID == 0)
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3334 player->uVoiceID = 19;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3335 else --player->uVoiceID;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3336 }
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3337 while (player->GetSexByVoice() != pSex);
971
Ritor1
parents: 970
diff changeset
3338 pButton = pCreationUI_BtnPressLeft2[pParam];
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
3339 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3340 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3341 player->PlaySound(SPEECH_PickMe, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3342 break;
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
3343 case UIMSG_PlayerCreation_VoiceNext:
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3344 pSex = player->GetSexByVoice();
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3345 do
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3346 {
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3347 player->uVoiceID = (player->uVoiceID + 1) % 20;
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3348 }
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3349 while (player->GetSexByVoice() != pSex);
971
Ritor1
parents: 970
diff changeset
3350 pButton = pCreationUI_BtnPressRight2[pParam];
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
3351 GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1);
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3352 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3353 player->PlaySound(SPEECH_PickMe, 0);
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3354 break;
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
3355 case UIMSG_PlayerCreation_FacePrev:
971
Ritor1
parents: 970
diff changeset
3356 pPlayer = &pParty->pPlayers[pParam];
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
3357 if (!pPlayer->uCurrentFace)
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
3358 pPlayer->uCurrentFace = 19;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3359 else
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
3360 pPlayer->uCurrentFace -= 1;
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
3361 pPlayer->uVoiceID = pPlayer->uCurrentFace;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3362 pPlayer->SetInitialStats();
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3363 pPlayer->SetSexByVoice();
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3364 pPlayer->RandomizeName();
971
Ritor1
parents: 970
diff changeset
3365 v25 = pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3366 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
971
Ritor1
parents: 970
diff changeset
3367 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3368 uPlayerCreationUI_SelectedCharacter = v25;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
3369 GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3370 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3371 pPlayer->PlaySound(SPEECH_PickMe, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3372 break;
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
3373 case UIMSG_PlayerCreation_FaceNext:
971
Ritor1
parents: 970
diff changeset
3374 pPlayer = &pParty->pPlayers[pParam];
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
3375 v20 = (char)((int)pPlayer->uCurrentFace + 1) % 20;
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
3376 pPlayer->uCurrentFace = v20;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3377 pPlayer->uVoiceID = v20;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3378 pPlayer->SetInitialStats();
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3379 pPlayer->SetSexByVoice();
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3380 pPlayer->RandomizeName();
971
Ritor1
parents: 970
diff changeset
3381 v21 = pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3382 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem)
971
Ritor1
parents: 970
diff changeset
3383 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3384 uPlayerCreationUI_SelectedCharacter = v21;
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
3385 GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3386 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3387 pPlayer->PlaySound(SPEECH_PickMe, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3388 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3389 case UIMSG_PlayerCreationClickPlus:
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
3390 GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3391 pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3392 pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3393 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3394 case UIMSG_PlayerCreationClickMinus:
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1264
diff changeset
3395 GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3396 pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3397 pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3398 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3399 case UIMSG_PlayerCreationSelectActiveSkill:
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3400 pPlayer = &pPlayer[uPlayerCreationUI_SelectedCharacter];
971
Ritor1
parents: 970
diff changeset
3401 v6 = pPlayer->GetSkillIdxByOrder(pParam + 4);
967
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3402 if ( pPlayer->GetSkillIdxByOrder(3) == 37 )
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3403 pParty->pPlayers[0].pActiveSkills[v6 + 3486 * uPlayerCreationUI_SelectedCharacter] = 1;
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3404 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
e655624e4b7c GUI_MainMenuMessageProc()
Ritor1
parents: 962
diff changeset
3405 break;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3406 case UIMSG_PlayerCreationSelectClass:
971
Ritor1
parents: 970
diff changeset
3407 pPlayer[uPlayerCreationUI_SelectedCharacter].Reset((PLAYER_CLASS_TYPE)pParam);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3408 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3409 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3410 case UIMSG_PlayerCreationClickOK:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3411 GUIWindow::Create(580, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnOK, 0);
1273
fbb7428fa58c PlayerCreation_ComputeAttributeBonus cleanup
Grumpy7
parents: 1268
diff changeset
3412 if ( PlayerCreation_GetUnspentAttributePointCount() || !PlayerCreation_Chose4Skills() )
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3413 GameUI_Footer_TimeLeft = GetTickCount() + 4000;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3414 else
982
08fd1436ef35 enums & lod
Nomad
parents: 980
diff changeset
3415 uGameState = GAME_STATE_STARTING_NEW_GAME;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3416 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3417 case UIMSG_PlayerCreationClickReset:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3418 GUIWindow::Create(527, 431, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnReset, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3419 pParty->Reset();
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3420 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3421 case UIMSG_PlayerCreationRemoveUpSkill:
971
Ritor1
parents: 970
diff changeset
3422 uPlayerCreationUI_SelectedCharacter = pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3423 v4 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3424 //int pSex = pGUIWindow_CurrentMenu->pStartingPosActiveItem;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3425 v41 = 2;
971
Ritor1
parents: 970
diff changeset
3426 v5 = v4 % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3427 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = v5;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3428 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(v41)
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3429 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3430 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3431 case UIMSG_PlayerCreationChangeName:
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3432 pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
971
Ritor1
parents: 970
diff changeset
3433 v3 = (void *)pParam;
Ritor1
parents: 970
diff changeset
3434 uPlayerCreationUI_SelectedCharacter = pParam;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3435 pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3436 pGUIWindow_CurrentMenu->ptr_1C = v3;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3437 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3438 case UIMSG_ChangeGameState:
978
9334a8c59c8d uGameState
Ritor1
parents: 977
diff changeset
3439 uGameState = GAME_FINISHED;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3440 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3441 case UIMSG_11:
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3442 pMouse->SetCursorBitmap("MICON2");
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3443 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3444 case UIMSG_3A:
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3445 SetCurrentMenuID(MENU_10);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3446 break;
165
Ritor1
parents: 163
diff changeset
3447 case UIMSG_LoadGame:
0
Ritor1
parents:
diff changeset
3448 if (!pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3449 break;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
3450 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3451 break;
165
Ritor1
parents: 163
diff changeset
3452 case UIMSG_SelectLoadSlot:
0
Ritor1
parents:
diff changeset
3453 //main menu save/load wnd clicking on savegame lines
1038
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
3454 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
39f42990698f Cleanings
Nomad
parents: 1035
diff changeset
3455 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
971
Ritor1
parents: 970
diff changeset
3456 if ( pCurrentScreen != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pParam + pSaveListPosition )
0
Ritor1
parents:
diff changeset
3457 {
Ritor1
parents:
diff changeset
3458 //load clicked line
971
Ritor1
parents: 970
diff changeset
3459 v26 = pParam + pSaveListPosition;
Ritor1
parents: 970
diff changeset
3460 if ( dword_6BE138 == pParam + pSaveListPosition )
0
Ritor1
parents:
diff changeset
3461 {
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
3462 pMessageQueue_50CBD0->AddMessage(UIMSG_SaveLoadBtn, 0, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3463 pMessageQueue_50CBD0->AddMessage(UIMSG_LoadGame, 0, 0);
0
Ritor1
parents:
diff changeset
3464 }
Ritor1
parents:
diff changeset
3465 uLoadGameUI_SelectedSlot = v26;
Ritor1
parents:
diff changeset
3466 dword_6BE138 = v26;
Ritor1
parents:
diff changeset
3467 }
Ritor1
parents:
diff changeset
3468 else
Ritor1
parents:
diff changeset
3469 {
Ritor1
parents:
diff changeset
3470 //typing in the line
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3471 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
0
Ritor1
parents:
diff changeset
3472 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
Ritor1
parents:
diff changeset
3473 pKeyActionMap->uNumKeysPressed = strlen((const char *)pKeyActionMap->pPressedKeysBuffer);
Ritor1
parents:
diff changeset
3474 }
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3475 break;
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
3476 case UIMSG_SaveLoadBtn:
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
3477 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 241, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_SaveLoadBtn, (int)pBtnLoadSlot, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3478 break;
165
Ritor1
parents: 163
diff changeset
3479 case UIMSG_DownArrow:
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3480 ++pSaveListPosition;
971
Ritor1
parents: 970
diff changeset
3481 if ( pSaveListPosition >= pParam )
Ritor1
parents: 970
diff changeset
3482 pSaveListPosition = pParam - 1;
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3483 if ( pSaveListPosition < 1 )
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3484 pSaveListPosition = 0;
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3485 pWindow = pGUIWindow_CurrentMenu;
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3486 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 323, 0, 0, WINDOW_PressedButton2, (int)pBtnDownArrow, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3487 break;
165
Ritor1
parents: 163
diff changeset
3488 case UIMSG_Cancel:
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3489 GUIWindow::Create(pGUIWindow_CurrentMenu->uFrameX + 350, pGUIWindow_CurrentMenu->uFrameY + 302, 61, 28, WINDOW_LoadGame_CancelBtn, (int)pBtnCancel, 0);
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3490 break;
165
Ritor1
parents: 163
diff changeset
3491 case UIMSG_ArrowUp:
3
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3492 --pSaveListPosition;
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3493 if ( pSaveListPosition < 0 )
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3494 pSaveListPosition = 0;
bf31c505f4d3 13.01.13(MainMenuMessageProc())
Ritor1
parents: 2
diff changeset
3495 pWindow = pGUIWindow_CurrentMenu;
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3496 GUIWindow::Create(pWindow->uFrameX + 215, pGUIWindow_CurrentMenu->uFrameY + 197, 0, 0, WINDOW_PressedButton2, (int)pBtnArrowUp, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3497 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3498 case UIMSG_AD:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3499 GUIWindow::Create(pMainMenu_BtnNew->uX, pMainMenu_BtnNew->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
961
5a12082c803d UIMSG and WINDOW_Type(continue)
Ritor1
parents: 960
diff changeset
3500 SetCurrentMenuID(MENU_LoadingProcInMainMenu);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3501 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3502 case UIMSG_AE:
962
0423c40d7e88 UpdateWindows and pWindow->Release
Ritor1
parents: 961
diff changeset
3503 GUIWindow::Create(pMainMenu_BtnExit->uX, pMainMenu_BtnExit->uY, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
165
Ritor1
parents: 163
diff changeset
3504 SetCurrentMenuID(MENU_10);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3505 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3506 case UIMSG_Escape:
0
Ritor1
parents:
diff changeset
3507 if ( ptr_507BDC )
Ritor1
parents:
diff changeset
3508 {
Ritor1
parents:
diff changeset
3509 sub_41426F();
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3510 break;
0
Ritor1
parents:
diff changeset
3511 }
Ritor1
parents:
diff changeset
3512 if ( !(BYTE1(dword_6BE364_game_settings_1) & 0x40) )
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3513 break;
0
Ritor1
parents:
diff changeset
3514 v15 = 1;
Ritor1
parents:
diff changeset
3515 pVideoPlayer->bStopBeforeSchedule = 1;
Ritor1
parents:
diff changeset
3516 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
3517 viewparams->field_48 = 1;
165
Ritor1
parents: 163
diff changeset
3518 if ( !GetCurrentMenuID() || GetCurrentMenuID() == MENU_CREATEPARTY || GetCurrentMenuID() == MENU_NAMEPANELESC )
Ritor1
parents: 163
diff changeset
3519 {
Ritor1
parents: 163
diff changeset
3520 if ( pCurrentScreen == SCREEN_VIDEO )
Ritor1
parents: 163
diff changeset
3521 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
Ritor1
parents: 163
diff changeset
3522 if (GetCurrentMenuID() == MENU_NAMEPANELESC)
Ritor1
parents: 163
diff changeset
3523 {
Ritor1
parents: 163
diff changeset
3524 SetCurrentMenuID(MENU_CREATEPARTY);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3525 break;
0
Ritor1
parents:
diff changeset
3526 }
165
Ritor1
parents: 163
diff changeset
3527 if (GetCurrentMenuID() == MENU_CREDITSPROC)
Ritor1
parents: 163
diff changeset
3528 {
Ritor1
parents: 163
diff changeset
3529 SetCurrentMenuID(MENU_CREDITSCLOSE);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3530 break;
0
Ritor1
parents:
diff changeset
3531 }
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
3532 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0);
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3533 break;
0
Ritor1
parents:
diff changeset
3534 }
971
Ritor1
parents: 970
diff changeset
3535 if ( GetCurrentMenuID() == MENU_CREDITSPROC && !pCurrentScreen )
Ritor1
parents: 970
diff changeset
3536 {
Ritor1
parents: 970
diff changeset
3537 if ( pCurrentScreen == SCREEN_VIDEO )
Ritor1
parents: 970
diff changeset
3538 pVideoPlayer->FastForwardToFrame(pVideoPlayer->pResetflag);
Ritor1
parents: 970
diff changeset
3539 if (GetCurrentMenuID() == MENU_NAMEPANELESC)
Ritor1
parents: 970
diff changeset
3540 {
Ritor1
parents: 970
diff changeset
3541 SetCurrentMenuID(MENU_CREATEPARTY);
Ritor1
parents: 970
diff changeset
3542 break;
Ritor1
parents: 970
diff changeset
3543 }
Ritor1
parents: 970
diff changeset
3544 if (GetCurrentMenuID() == MENU_CREDITSPROC)
Ritor1
parents: 970
diff changeset
3545 {
Ritor1
parents: 970
diff changeset
3546 SetCurrentMenuID(MENU_CREDITSCLOSE);
Ritor1
parents: 970
diff changeset
3547 break;
Ritor1
parents: 970
diff changeset
3548 }
Ritor1
parents: 970
diff changeset
3549 pMessageQueue_50CBD0->AddMessage(UIMSG_ChangeGameState, 0, 0);
Ritor1
parents: 970
diff changeset
3550 break;
Ritor1
parents: 970
diff changeset
3551 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3552 if ( pCurrentScreen == SCREEN_LOADGAME )
0
Ritor1
parents:
diff changeset
3553 {
Ritor1
parents:
diff changeset
3554 pIcons_LOD->_4114F2();
Ritor1
parents:
diff changeset
3555 //crt_deconstruct_ptr_6A0118();
Ritor1
parents:
diff changeset
3556 pTexture_PCX.Release();
Ritor1
parents:
diff changeset
3557 pTexture_PCX.Load("title.pcx", 0);
Ritor1
parents:
diff changeset
3558 SetCurrentMenuID(MENU_MAIN);
Ritor1
parents:
diff changeset
3559 v15 = 1;
Ritor1
parents:
diff changeset
3560 pGUIWindow_CurrentMenu->Release();
Ritor1
parents:
diff changeset
3561 pGUIWindow2->Release();
Ritor1
parents:
diff changeset
3562 pGUIWindow2 = 0;
Ritor1
parents:
diff changeset
3563 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3564 pCurrentScreen = SCREEN_GAME;
0
Ritor1
parents:
diff changeset
3565 viewparams->bRedrawGameUI = v15;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3566 break;
0
Ritor1
parents:
diff changeset
3567 }
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3568 if ( pCurrentScreen == SCREEN_VIDEO )
0
Ritor1
parents:
diff changeset
3569 {
Ritor1
parents:
diff changeset
3570 pVideoPlayer->Unload();
Ritor1
parents:
diff changeset
3571 }
Ritor1
parents:
diff changeset
3572 else
Ritor1
parents:
diff changeset
3573 {
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3574 if ( pCurrentScreen != SCREEN_1B )
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3575 {
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3576 pGUIWindow_CurrentMenu->Release();
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3577 pGUIWindow2->Release();
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3578 pGUIWindow2 = 0;
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3579 pEventTimer->Resume();
151
9abdd40a107b pCurrentScreen
Ritor1
parents: 150
diff changeset
3580 pCurrentScreen = SCREEN_GAME;
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3581 viewparams->bRedrawGameUI = v15;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3582 break;
2
89240115d392 MainMenuBtn(work)
Ritor1
parents: 1
diff changeset
3583 }
0
Ritor1
parents:
diff changeset
3584 //VideoPlayer::dtor();
Ritor1
parents:
diff changeset
3585 }
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3586 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3587 case UIMSG_PlayerCreationRemoveDownSkill:
971
Ritor1
parents: 970
diff changeset
3588 uPlayerCreationUI_SelectedCharacter = pParam;
165
Ritor1
parents: 163
diff changeset
3589 pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7
971
Ritor1
parents: 970
diff changeset
3590 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam;
165
Ritor1
parents: 163
diff changeset
3591 pParty->pPlayers[0].pActiveSkills[(&pPlayer[uPlayerCreationUI_SelectedCharacter])->GetSkillIdxByOrder(3)
0
Ritor1
parents:
diff changeset
3592 + 3486 * uPlayerCreationUI_SelectedCharacter] = 0;
960
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3593 break;
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3594 default:
9a5db2cf999a UIMSG and WINDOW_Type
Ritor1
parents: 959
diff changeset
3595 break;
0
Ritor1
parents:
diff changeset
3596 }
Ritor1
parents:
diff changeset
3597 }
Ritor1
parents:
diff changeset
3598 while ( pMessageQueue_50CBD0->uNumMessages );
Ritor1
parents:
diff changeset
3599 }
Ritor1
parents:
diff changeset
3600 }
Ritor1
parents:
diff changeset
3601
Ritor1
parents:
diff changeset
3602 //----- (00436427) --------------------------------------------------------
Ritor1
parents:
diff changeset
3603 double __cdecl get_shading_dist_mist()
Ritor1
parents:
diff changeset
3604 {
Ritor1
parents:
diff changeset
3605 double result; // st7@2
Ritor1
parents:
diff changeset
3606
Ritor1
parents:
diff changeset
3607 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
3608 result = (double)pOutdoorCamera->shading_dist_mist;
Ritor1
parents:
diff changeset
3609 else
Ritor1
parents:
diff changeset
3610 result = 16192.0;
Ritor1
parents:
diff changeset
3611 return result;
Ritor1
parents:
diff changeset
3612 }
Ritor1
parents:
diff changeset
3613
Ritor1
parents:
diff changeset
3614 //----- (0043648F) --------------------------------------------------------
Ritor1
parents:
diff changeset
3615 void Vec3_short__to_RenderVertexSoft(RenderVertexSoft *_this, Vec3_short_ *a2)
Ritor1
parents:
diff changeset
3616 {
Ritor1
parents:
diff changeset
3617 _this->flt_2C = 0.0;
Ritor1
parents:
diff changeset
3618
Ritor1
parents:
diff changeset
3619 _this->vWorldPosition.x = a2->x;
Ritor1
parents:
diff changeset
3620 _this->vWorldPosition.y = a2->y;
Ritor1
parents:
diff changeset
3621 _this->vWorldPosition.z = a2->z;
Ritor1
parents:
diff changeset
3622 }
Ritor1
parents:
diff changeset
3623
Ritor1
parents:
diff changeset
3624 //----- (004369DB) --------------------------------------------------------
Ritor1
parents:
diff changeset
3625 void Vec3_float_::Normalize()
Ritor1
parents:
diff changeset
3626 {
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
3627 this->x = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->x;
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
3628 this->y = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->y;
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
3629 this->z = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->z;
0
Ritor1
parents:
diff changeset
3630 }
Ritor1
parents:
diff changeset
3631
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3632 //----- (00438526) --------------------------------------------------------
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3633 stru11::stru11()
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3634 {
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3635 stru11 *v1; // esi@1
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3636 signed int v2; // eax@1
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3637 char *v3; // edx@1
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3638
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3639 v1 = this;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3640 v2 = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3641 this->cpuid_00000000_eax_numops = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3642 this->cpuid_00000001_eax = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3643 this->cpuid_00000001_edx = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3644 this->field_38 = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3645 this->field_3C = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3646 this->cpuid_80000000_edx = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3647 this->cpuid_80000001_eax = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3648 this->cpuid_80000001_edx = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3649 this->cpuid_80000005_ebx = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3650 this->cpuid_80000005_ecx = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3651 this->cpuid_80000005_edx = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3652 this->cpuid_80000006_ecx = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3653 this->field_AC = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3654 this->uProcessorManufacturer = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3655 LOBYTE(this->cpuid_80000002_registers2[0]) = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3656 v3 = (char *)&this->cpuid_00000002_eax;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3657 do
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3658 {
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3659 if ( v2 < 3 )
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3660 *((int *)v3 - 9) = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3661 if ( v2 < 4 )
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3662 *(int *)v3 = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3663 if ( v2 < 12 )
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3664 *((int *)v3 + 17) = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3665 if ( v2 < 13 )
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3666 this->pCPUString[v2] = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3667 if ( v2 < 30 )
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3668 *((char *)this->field_40 + v2) = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3669 *((char *)&this->cpuid_80000002_registers2[0] + v2++ + 1) = 0;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3670 v3 += 4;
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3671 }
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3672 while ( v2 < 48 );
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3673 CheckCPU();
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3674 }
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1254
diff changeset
3675
0
Ritor1
parents:
diff changeset
3676 //----- (004385B5) --------------------------------------------------------
Ritor1
parents:
diff changeset
3677 void stru11::CheckCPU()
Ritor1
parents:
diff changeset
3678 {
Ritor1
parents:
diff changeset
3679 LOG_DECOMPILATION_WARNING();
Ritor1
parents:
diff changeset
3680 /*
Ritor1
parents:
diff changeset
3681 int v5; // [sp-4h] [bp-10h]@0
Ritor1
parents:
diff changeset
3682 signed int v6; // [sp+4h] [bp-8h]@1
Ritor1
parents:
diff changeset
3683 signed int v7; // [sp+8h] [bp-4h]@1
Ritor1
parents:
diff changeset
3684
Ritor1
parents:
diff changeset
3685 _CF = 0;
Ritor1
parents:
diff changeset
3686 _OF = 0;
Ritor1
parents:
diff changeset
3687 _ZF = 1;
Ritor1
parents:
diff changeset
3688 _SF = 0;
Ritor1
parents:
diff changeset
3689 v7 = 0;
Ritor1
parents:
diff changeset
3690 __asm { pushf }
Ritor1
parents:
diff changeset
3691 v6 = 3;
Ritor1
parents:
diff changeset
3692 if ( v5 != (v5 ^ 0x40000) )
Ritor1
parents:
diff changeset
3693 {
Ritor1
parents:
diff changeset
3694 __asm { popf }
Ritor1
parents:
diff changeset
3695 v6 = 4;
Ritor1
parents:
diff changeset
3696 __asm { pushf }
Ritor1
parents:
diff changeset
3697 if ( v5 != (v5 ^ 0x200000) )
Ritor1
parents:
diff changeset
3698 {
Ritor1
parents:
diff changeset
3699 v7 = 1;
Ritor1
parents:
diff changeset
3700 v6 = 0;
Ritor1
parents:
diff changeset
3701 }
Ritor1
parents:
diff changeset
3702 }
Ritor1
parents:
diff changeset
3703 if ( v6 == 3 )
Ritor1
parents:
diff changeset
3704 {
Ritor1
parents:
diff changeset
3705 this->field_AC = 1;
Ritor1
parents:
diff changeset
3706 }
Ritor1
parents:
diff changeset
3707 else
Ritor1
parents:
diff changeset
3708 {
Ritor1
parents:
diff changeset
3709 if ( v6 == 4 )
Ritor1
parents:
diff changeset
3710 {
Ritor1
parents:
diff changeset
3711 this->field_AC = 2;
Ritor1
parents:
diff changeset
3712 }
Ritor1
parents:
diff changeset
3713 else
Ritor1
parents:
diff changeset
3714 {
Ritor1
parents:
diff changeset
3715 if ( v7 )
Ritor1
parents:
diff changeset
3716 {
Ritor1
parents:
diff changeset
3717 this->field_AC = 2;
Ritor1
parents:
diff changeset
3718 RunCPUID();
Ritor1
parents:
diff changeset
3719 }
Ritor1
parents:
diff changeset
3720 else
Ritor1
parents:
diff changeset
3721 {
Ritor1
parents:
diff changeset
3722 this->field_AC = 0;
Ritor1
parents:
diff changeset
3723 }
Ritor1
parents:
diff changeset
3724 }
Ritor1
parents:
diff changeset
3725 }*/
Ritor1
parents:
diff changeset
3726 }
Ritor1
parents:
diff changeset
3727
Ritor1
parents:
diff changeset
3728 //----- (00438659) --------------------------------------------------------
Ritor1
parents:
diff changeset
3729 void stru11::RunCPUID()
Ritor1
parents:
diff changeset
3730 {
Ritor1
parents:
diff changeset
3731 __debugbreak();
Ritor1
parents:
diff changeset
3732 /*stru11 *v6; // esi@1
Ritor1
parents:
diff changeset
3733 unsigned int uNumOps; // edi@1
Ritor1
parents:
diff changeset
3734 int uNumExtOps; // edi@16
Ritor1
parents:
diff changeset
3735 char pCyrixString[16]; // [sp+Ch] [bp-60h]@1
Ritor1
parents:
diff changeset
3736 char pCentaurString[16]; // [sp+1Ch] [bp-50h]@1
Ritor1
parents:
diff changeset
3737 char pAMDString[16]; // [sp+2Ch] [bp-40h]@1
Ritor1
parents:
diff changeset
3738 char pIntelString[16]; // [sp+3Ch] [bp-30h]@1
Ritor1
parents:
diff changeset
3739 char pCPUString[16]; // [sp+4Ch] [bp-20h]@1
Ritor1
parents:
diff changeset
3740 stru11 *thisa; // [sp+5Ch] [bp-10h]@1
Ritor1
parents:
diff changeset
3741 char *v35; // [sp+60h] [bp-Ch]@1
Ritor1
parents:
diff changeset
3742 int v36; // [sp+64h] [bp-8h]@1
Ritor1
parents:
diff changeset
3743 int v37; // [sp+68h] [bp-4h]@1
Ritor1
parents:
diff changeset
3744
Ritor1
parents:
diff changeset
3745 thisa = this;
Ritor1
parents:
diff changeset
3746 *(int *)pIntelString = *(int *)"GenuineIntel";
Ritor1
parents:
diff changeset
3747 *(int *)&pIntelString[4] = *(int *)"ineIntel";
Ritor1
parents:
diff changeset
3748 *(int *)&pIntelString[8] = *(int *)"ntel";
Ritor1
parents:
diff changeset
3749 pIntelString[12] = aGenuineintel[12];
Ritor1
parents:
diff changeset
3750 *(int *)pAMDString = *(int *)"AuthenticAMD";
Ritor1
parents:
diff changeset
3751 *(int *)&pAMDString[4] = *(int *)"enticAMD";
Ritor1
parents:
diff changeset
3752 *(int *)&pAMDString[8] = *(int *)"cAMD";
Ritor1
parents:
diff changeset
3753 pAMDString[12] = aAuthenticamd[12];
Ritor1
parents:
diff changeset
3754 *(int *)pCyrixString = *(int *)"CyrixInstead";
Ritor1
parents:
diff changeset
3755 *(int *)&pCyrixString[4] = *(int *)"xInstead";
Ritor1
parents:
diff changeset
3756 *(int *)&pCyrixString[8] = *(int *)"tead";
Ritor1
parents:
diff changeset
3757 pCyrixString[12] = aCyrixinstead[12];
Ritor1
parents:
diff changeset
3758 *(int *)pCentaurString = *(int *)"CentaurHauls";
Ritor1
parents:
diff changeset
3759 *(int *)&pCentaurString[4] = *(int *)"aurHauls";
Ritor1
parents:
diff changeset
3760 *(int *)&pCentaurString[8] = *(int *)"auls";
Ritor1
parents:
diff changeset
3761 v37 = 0;
Ritor1
parents:
diff changeset
3762 v36 = 0;
Ritor1
parents:
diff changeset
3763 pCentaurString[12] = aCentaurhauls[12];
Ritor1
parents:
diff changeset
3764 v35 = pCPUString;
Ritor1
parents:
diff changeset
3765 pCPUString[12] = 0;
Ritor1
parents:
diff changeset
3766 _EAX = 0;
Ritor1
parents:
diff changeset
3767 __asm { cpuid }
Ritor1
parents:
diff changeset
3768 v37 = _EAX;
Ritor1
parents:
diff changeset
3769 *(int *)pCPUString = _EBX;
Ritor1
parents:
diff changeset
3770 *(int *)&pCPUString[4] = _EDX;
Ritor1
parents:
diff changeset
3771 *(int *)&pCPUString[8] = _ECX;
Ritor1
parents:
diff changeset
3772 v6 = thisa;
Ritor1
parents:
diff changeset
3773 uNumOps = _EAX;
Ritor1
parents:
diff changeset
3774 thisa->cpuid_00000000_ebx_vendorstr1 = _EBX;
Ritor1
parents:
diff changeset
3775 v6->cpuid_00000000_edx_vendorstr2 = *(int *)&pCPUString[4];
Ritor1
parents:
diff changeset
3776 v6->cpuid_00000000_ecx_vendorstr3 = *(int *)&pCPUString[8];
Ritor1
parents:
diff changeset
3777 v6->cpuid_00000000_eax_numops = _EAX;
Ritor1
parents:
diff changeset
3778 strcpy(v6->pCPUString, pCPUString);
Ritor1
parents:
diff changeset
3779 if ( strcmp(pIntelString, pCPUString) )
Ritor1
parents:
diff changeset
3780 {
Ritor1
parents:
diff changeset
3781 if ( strcmp(pAMDString, pCPUString) )
Ritor1
parents:
diff changeset
3782 {
Ritor1
parents:
diff changeset
3783 if ( strcmp(pCyrixString, pCPUString) )
Ritor1
parents:
diff changeset
3784 {
Ritor1
parents:
diff changeset
3785 if ( strcmp(pCentaurString, pCPUString) )
Ritor1
parents:
diff changeset
3786 v6->uProcessorManufacturer = 0;
Ritor1
parents:
diff changeset
3787 else
Ritor1
parents:
diff changeset
3788 v6->uProcessorManufacturer = 4;
Ritor1
parents:
diff changeset
3789 }
Ritor1
parents:
diff changeset
3790 else
Ritor1
parents:
diff changeset
3791 {
Ritor1
parents:
diff changeset
3792 v6->uProcessorManufacturer = 3;
Ritor1
parents:
diff changeset
3793 }
Ritor1
parents:
diff changeset
3794 }
Ritor1
parents:
diff changeset
3795 else
Ritor1
parents:
diff changeset
3796 {
Ritor1
parents:
diff changeset
3797 v6->uProcessorManufacturer = 2;
Ritor1
parents:
diff changeset
3798 }
Ritor1
parents:
diff changeset
3799 }
Ritor1
parents:
diff changeset
3800 else
Ritor1
parents:
diff changeset
3801 {
Ritor1
parents:
diff changeset
3802 v6->uProcessorManufacturer = 1;
Ritor1
parents:
diff changeset
3803 }
Ritor1
parents:
diff changeset
3804 if ( uNumOps >= 1 )
Ritor1
parents:
diff changeset
3805 RunCPUID_op1();
Ritor1
parents:
diff changeset
3806 if ( uNumOps >= 2 )
Ritor1
parents:
diff changeset
3807 RunCPUID_op2();
Ritor1
parents:
diff changeset
3808 _EAX = 0x80000000u;
Ritor1
parents:
diff changeset
3809 __asm { cpuid }
Ritor1
parents:
diff changeset
3810 if ( !(_EAX & 0x80000000) )
Ritor1
parents:
diff changeset
3811 _EAX = 0x80000000u;
Ritor1
parents:
diff changeset
3812 v36 = _EAX;
Ritor1
parents:
diff changeset
3813 v6->cpuid_80000000_edx = _EAX;
Ritor1
parents:
diff changeset
3814 uNumExtOps = _EAX ^ 0x80000000;
Ritor1
parents:
diff changeset
3815 if ( (_EAX ^ 0x80000000u) >= 1 )
Ritor1
parents:
diff changeset
3816 {
Ritor1
parents:
diff changeset
3817 _EAX = 0x80000001u;
Ritor1
parents:
diff changeset
3818 __asm { cpuid }
Ritor1
parents:
diff changeset
3819 thisa = (stru11 *)_EAX;
Ritor1
parents:
diff changeset
3820 v35 = (char *)_EDX;
Ritor1
parents:
diff changeset
3821 v6->cpuid_80000001_eax = _EAX;
Ritor1
parents:
diff changeset
3822 v6->cpuid_80000001_edx = (int)v35;
Ritor1
parents:
diff changeset
3823 }
Ritor1
parents:
diff changeset
3824 if ( (unsigned int)uNumExtOps >= 4 )
Ritor1
parents:
diff changeset
3825 RunCPUID_ext2_3_4();
Ritor1
parents:
diff changeset
3826 if ( (unsigned int)uNumExtOps >= 5 )
Ritor1
parents:
diff changeset
3827 {
Ritor1
parents:
diff changeset
3828 _EAX = 0x80000005u;
Ritor1
parents:
diff changeset
3829 __asm { cpuid }
Ritor1
parents:
diff changeset
3830 thisa = (stru11 *)_EBX;
Ritor1
parents:
diff changeset
3831 v35 = (char *)_ECX;
Ritor1
parents:
diff changeset
3832 v36 = _EDX;
Ritor1
parents:
diff changeset
3833 v6->cpuid_80000005_ebx = _EBX;
Ritor1
parents:
diff changeset
3834 v6->cpuid_80000005_ecx = (int)v35;
Ritor1
parents:
diff changeset
3835 v6->cpuid_80000005_edx = v36;
Ritor1
parents:
diff changeset
3836 }
Ritor1
parents:
diff changeset
3837 if ( (unsigned int)uNumExtOps >= 6 )
Ritor1
parents:
diff changeset
3838 {
Ritor1
parents:
diff changeset
3839 _EAX = 0x80000006u;
Ritor1
parents:
diff changeset
3840 __asm { cpuid }
Ritor1
parents:
diff changeset
3841 v6->cpuid_80000006_ecx = _ECX;
Ritor1
parents:
diff changeset
3842 }*/
Ritor1
parents:
diff changeset
3843 }
Ritor1
parents:
diff changeset
3844
Ritor1
parents:
diff changeset
3845 //----- (00438821) --------------------------------------------------------
Ritor1
parents:
diff changeset
3846 void stru11::RunCPUID_op1()
Ritor1
parents:
diff changeset
3847 {
Ritor1
parents:
diff changeset
3848 __debugbreak();
Ritor1
parents:
diff changeset
3849 /*stru11 *v1; // esi@1
Ritor1
parents:
diff changeset
3850 unsigned int v7; // ecx@1
Ritor1
parents:
diff changeset
3851 int v8; // eax@3
Ritor1
parents:
diff changeset
3852 int v9; // eax@10
Ritor1
parents:
diff changeset
3853 signed int v10; // eax@11
Ritor1
parents:
diff changeset
3854 int v11; // ecx@11
Ritor1
parents:
diff changeset
3855 int v12; // eax@15
Ritor1
parents:
diff changeset
3856 signed int v13; // eax@19
Ritor1
parents:
diff changeset
3857 int v14; // ecx@19
Ritor1
parents:
diff changeset
3858 signed int v15; // eax@25
Ritor1
parents:
diff changeset
3859 int v16; // ecx@25
Ritor1
parents:
diff changeset
3860 signed int v17; // eax@34
Ritor1
parents:
diff changeset
3861 int v18; // ecx@34
Ritor1
parents:
diff changeset
3862
Ritor1
parents:
diff changeset
3863 v1 = this;
Ritor1
parents:
diff changeset
3864 _EAX = 1;
Ritor1
parents:
diff changeset
3865 __asm { cpuid }
Ritor1
parents:
diff changeset
3866 v7 = _EAX;
Ritor1
parents:
diff changeset
3867 v1->cpuid_00000001_edx = _EDX;
Ritor1
parents:
diff changeset
3868 v1->cpuid_00000001_eax = _EAX;
Ritor1
parents:
diff changeset
3869 if ( (_EAX & 0x3000) == 8192 )
Ritor1
parents:
diff changeset
3870 {
Ritor1
parents:
diff changeset
3871 LOBYTE(v1->cpuid_80000002_registers2[0]) = 1;
Ritor1
parents:
diff changeset
3872 v7 = 0;
Ritor1
parents:
diff changeset
3873 }
Ritor1
parents:
diff changeset
3874 v8 = (v7 >> 8) & 0xF;
Ritor1
parents:
diff changeset
3875 switch ( v8 )
Ritor1
parents:
diff changeset
3876 {
Ritor1
parents:
diff changeset
3877 case 4:
Ritor1
parents:
diff changeset
3878 v1->field_AC = 2;
Ritor1
parents:
diff changeset
3879 break;
Ritor1
parents:
diff changeset
3880 case 5:
Ritor1
parents:
diff changeset
3881 v1->field_AC = 15;
Ritor1
parents:
diff changeset
3882 break;
Ritor1
parents:
diff changeset
3883 case 6:
Ritor1
parents:
diff changeset
3884 v1->field_AC = 36;
Ritor1
parents:
diff changeset
3885 break;
Ritor1
parents:
diff changeset
3886 default:
Ritor1
parents:
diff changeset
3887 v1->field_AC = 49;
Ritor1
parents:
diff changeset
3888 break;
Ritor1
parents:
diff changeset
3889 }
Ritor1
parents:
diff changeset
3890 v9 = v1->uProcessorManufacturer;
Ritor1
parents:
diff changeset
3891 if ( v9 == 1 )
Ritor1
parents:
diff changeset
3892 {
Ritor1
parents:
diff changeset
3893 v10 = 0;
Ritor1
parents:
diff changeset
3894 v11 = v7 & 0x3FF0;
Ritor1
parents:
diff changeset
3895 while ( v11 != dword_4E4948[2 * v10] )
Ritor1
parents:
diff changeset
3896 {
Ritor1
parents:
diff changeset
3897 ++v10;
Ritor1
parents:
diff changeset
3898 if ( v10 >= 17 )
Ritor1
parents:
diff changeset
3899 return;
Ritor1
parents:
diff changeset
3900 }
Ritor1
parents:
diff changeset
3901 v12 = dword_4E494C[2 * v10];
Ritor1
parents:
diff changeset
3902 goto LABEL_39;
Ritor1
parents:
diff changeset
3903 }
Ritor1
parents:
diff changeset
3904 if ( v9 == 2 )
Ritor1
parents:
diff changeset
3905 {
Ritor1
parents:
diff changeset
3906 if ( (v7 & 0xF00) == dword_4E49D0[0] )
Ritor1
parents:
diff changeset
3907 {
Ritor1
parents:
diff changeset
3908 v12 = dword_4E49D4[0];
Ritor1
parents:
diff changeset
3909 }
Ritor1
parents:
diff changeset
3910 else
Ritor1
parents:
diff changeset
3911 {
Ritor1
parents:
diff changeset
3912 v13 = 1;
Ritor1
parents:
diff changeset
3913 v14 = v7 & 0x3FF0;
Ritor1
parents:
diff changeset
3914 while ( v14 != dword_4E49D0[2 * v13] )
Ritor1
parents:
diff changeset
3915 {
Ritor1
parents:
diff changeset
3916 ++v13;
Ritor1
parents:
diff changeset
3917 if ( v13 >= 9 )
Ritor1
parents:
diff changeset
3918 return;
Ritor1
parents:
diff changeset
3919 }
Ritor1
parents:
diff changeset
3920 v12 = dword_4E49D4[2 * v13];
Ritor1
parents:
diff changeset
3921 }
Ritor1
parents:
diff changeset
3922 goto LABEL_39;
Ritor1
parents:
diff changeset
3923 }
Ritor1
parents:
diff changeset
3924 if ( v9 != 3 )
Ritor1
parents:
diff changeset
3925 {
Ritor1
parents:
diff changeset
3926 if ( v9 != 4 )
Ritor1
parents:
diff changeset
3927 return;
Ritor1
parents:
diff changeset
3928 v17 = 0;
Ritor1
parents:
diff changeset
3929 v18 = v7 & 0x3FF0;
Ritor1
parents:
diff changeset
3930 while ( v18 != dword_4E4A40[2 * v17] )
Ritor1
parents:
diff changeset
3931 {
Ritor1
parents:
diff changeset
3932 ++v17;
Ritor1
parents:
diff changeset
3933 if ( v17 >= 2 )
Ritor1
parents:
diff changeset
3934 return;
Ritor1
parents:
diff changeset
3935 }
Ritor1
parents:
diff changeset
3936 v12 = dword_4E4A44[2 * v17];
Ritor1
parents:
diff changeset
3937 goto LABEL_39;
Ritor1
parents:
diff changeset
3938 }
Ritor1
parents:
diff changeset
3939 v15 = 1;
Ritor1
parents:
diff changeset
3940 v16 = v7 & 0x3FF0;
Ritor1
parents:
diff changeset
3941 while ( v16 != dword_4E4A18[2 * v15] )
Ritor1
parents:
diff changeset
3942 {
Ritor1
parents:
diff changeset
3943 ++v15;
Ritor1
parents:
diff changeset
3944 if ( v15 >= 5 )
Ritor1
parents:
diff changeset
3945 goto LABEL_30;
Ritor1
parents:
diff changeset
3946 }
Ritor1
parents:
diff changeset
3947 v1->field_AC = dword_4E4A1C[2 * v15];
Ritor1
parents:
diff changeset
3948 LABEL_30:
Ritor1
parents:
diff changeset
3949 v12 = 24;
Ritor1
parents:
diff changeset
3950 if ( v1->field_AC == 24 )
Ritor1
parents:
diff changeset
3951 {
Ritor1
parents:
diff changeset
3952 if ( _EDX != 1 )
Ritor1
parents:
diff changeset
3953 v12 = (((_EDX != 261) - 1) & 0xA) + 15;
Ritor1
parents:
diff changeset
3954 LABEL_39:
Ritor1
parents:
diff changeset
3955 v1->field_AC = v12;
Ritor1
parents:
diff changeset
3956 }*/
Ritor1
parents:
diff changeset
3957 }
Ritor1
parents:
diff changeset
3958
Ritor1
parents:
diff changeset
3959 //----- (00438992) --------------------------------------------------------
Ritor1
parents:
diff changeset
3960 void stru11::RunCPUID_op2()
Ritor1
parents:
diff changeset
3961 {
Ritor1
parents:
diff changeset
3962 __debugbreak();
Ritor1
parents:
diff changeset
3963 /*
Ritor1
parents:
diff changeset
3964 stru11 *v1; // edi@1
Ritor1
parents:
diff changeset
3965 int v7; // eax@1
Ritor1
parents:
diff changeset
3966 signed int v8; // ecx@2
Ritor1
parents:
diff changeset
3967 unsigned __int8 v9; // al@3
Ritor1
parents:
diff changeset
3968 signed int v10; // ecx@14
Ritor1
parents:
diff changeset
3969 unsigned __int8 v11; // al@15
Ritor1
parents:
diff changeset
3970 int v12; // [sp+Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
3971 int v13; // [sp+10h] [bp-10h]@1
Ritor1
parents:
diff changeset
3972 int v14; // [sp+14h] [bp-Ch]@1
Ritor1
parents:
diff changeset
3973 int v15; // [sp+18h] [bp-8h]@1
Ritor1
parents:
diff changeset
3974 int *v16; // [sp+1Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
3975
Ritor1
parents:
diff changeset
3976 v1 = this;
Ritor1
parents:
diff changeset
3977 v16 = &v12;
Ritor1
parents:
diff changeset
3978 _EAX = 2;
Ritor1
parents:
diff changeset
3979 __asm { cpuid }
Ritor1
parents:
diff changeset
3980 v12 = _EAX;
Ritor1
parents:
diff changeset
3981 v13 = _EBX;
Ritor1
parents:
diff changeset
3982 v14 = _ECX;
Ritor1
parents:
diff changeset
3983 v15 = _EDX;
Ritor1
parents:
diff changeset
3984 v1->cpuid_00000002_eax = _EAX;
Ritor1
parents:
diff changeset
3985 v1->cpuid_00000002_ebx = v13;
Ritor1
parents:
diff changeset
3986 v1->cpuid_00000002_ecx = v14;
Ritor1
parents:
diff changeset
3987 v1->cpuid_00000002_edx = v15;
Ritor1
parents:
diff changeset
3988 v7 = v1->field_AC;
Ritor1
parents:
diff changeset
3989 if ( v7 == 40 )
Ritor1
parents:
diff changeset
3990 {
Ritor1
parents:
diff changeset
3991 v8 = 0;
Ritor1
parents:
diff changeset
3992 while ( 1 )
Ritor1
parents:
diff changeset
3993 {
Ritor1
parents:
diff changeset
3994 v9 = *((char *)&v12 + v8);
Ritor1
parents:
diff changeset
3995 if ( v9 == 64 )
Ritor1
parents:
diff changeset
3996 {
Ritor1
parents:
diff changeset
3997 v1->field_AC = 43;
Ritor1
parents:
diff changeset
3998 return;
Ritor1
parents:
diff changeset
3999 }
Ritor1
parents:
diff changeset
4000 if ( v9 >= 0x41u && v9 <= 0x43u )
Ritor1
parents:
diff changeset
4001 {
Ritor1
parents:
diff changeset
4002 v1->field_AC = 41;
Ritor1
parents:
diff changeset
4003 return;
Ritor1
parents:
diff changeset
4004 }
Ritor1
parents:
diff changeset
4005 if ( v9 >= 0x44u && v9 <= 0x45u )
Ritor1
parents:
diff changeset
4006 break;
Ritor1
parents:
diff changeset
4007 ++v8;
Ritor1
parents:
diff changeset
4008 if ( v8 >= 16 )
Ritor1
parents:
diff changeset
4009 return;
Ritor1
parents:
diff changeset
4010 }
Ritor1
parents:
diff changeset
4011 v1->field_AC = 42;
Ritor1
parents:
diff changeset
4012 }
Ritor1
parents:
diff changeset
4013 else
Ritor1
parents:
diff changeset
4014 {
Ritor1
parents:
diff changeset
4015 if ( v7 == 45 )
Ritor1
parents:
diff changeset
4016 {
Ritor1
parents:
diff changeset
4017 v10 = 0;
Ritor1
parents:
diff changeset
4018 while ( 1 )
Ritor1
parents:
diff changeset
4019 {
Ritor1
parents:
diff changeset
4020 v11 = *((char *)&v12 + v10);
Ritor1
parents:
diff changeset
4021 if ( v11 >= 0x40u && v11 <= 0x43u )
Ritor1
parents:
diff changeset
4022 {
Ritor1
parents:
diff changeset
4023 v1->field_AC = 46;
Ritor1
parents:
diff changeset
4024 return;
Ritor1
parents:
diff changeset
4025 }
Ritor1
parents:
diff changeset
4026 if ( v11 >= 0x44u && v11 <= 0x45u )
Ritor1
parents:
diff changeset
4027 break;
Ritor1
parents:
diff changeset
4028 ++v10;
Ritor1
parents:
diff changeset
4029 if ( v10 >= 16 )
Ritor1
parents:
diff changeset
4030 return;
Ritor1
parents:
diff changeset
4031 }
Ritor1
parents:
diff changeset
4032 v1->field_AC = 47;
Ritor1
parents:
diff changeset
4033 }
Ritor1
parents:
diff changeset
4034 }*/
Ritor1
parents:
diff changeset
4035 }
Ritor1
parents:
diff changeset
4036
Ritor1
parents:
diff changeset
4037 //----- (00438A67) --------------------------------------------------------
Ritor1
parents:
diff changeset
4038 void stru11::RunCPUID_ext2_3_4()
Ritor1
parents:
diff changeset
4039 {
Ritor1
parents:
diff changeset
4040 __debugbreak();
Ritor1
parents:
diff changeset
4041 /*stru11 *v1; // edi@1
Ritor1
parents:
diff changeset
4042 stru11 *v17; // eax@1
Ritor1
parents:
diff changeset
4043 int v18[3][4]; // [sp+Ch] [bp-38h]@1
Ritor1
parents:
diff changeset
4044 stru11 *v19; // [sp+3Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
4045
Ritor1
parents:
diff changeset
4046 v1 = this;
Ritor1
parents:
diff changeset
4047 v19 = this;
Ritor1
parents:
diff changeset
4048 _EAX = 0x80000002u;
Ritor1
parents:
diff changeset
4049 __asm { cpuid }
Ritor1
parents:
diff changeset
4050 v18[0][0] = _EAX;
Ritor1
parents:
diff changeset
4051 *(_QWORD *)&v18[0][1] = __PAIR__(_ECX, _EBX);
Ritor1
parents:
diff changeset
4052 v18[0][3] = _EDX;
Ritor1
parents:
diff changeset
4053 _EAX = 0x80000003u;
Ritor1
parents:
diff changeset
4054 __asm { cpuid }
Ritor1
parents:
diff changeset
4055 v18[1][0] = _EAX;
Ritor1
parents:
diff changeset
4056 *(_QWORD *)&v18[1][1] = __PAIR__(_ECX, _EBX);
Ritor1
parents:
diff changeset
4057 v18[1][3] = _EDX;
Ritor1
parents:
diff changeset
4058 _EAX = 0x80000004u;
Ritor1
parents:
diff changeset
4059 __asm { cpuid }
Ritor1
parents:
diff changeset
4060 v18[2][0] = _EAX;
Ritor1
parents:
diff changeset
4061 *(_QWORD *)&v18[2][1] = __PAIR__(_ECX, _EBX);
Ritor1
parents:
diff changeset
4062 v18[2][3] = _EDX;
Ritor1
parents:
diff changeset
4063 v17 = v19;
Ritor1
parents:
diff changeset
4064 memcpy(v1->cpuid_80000002_registers, v18, 0x30u);
Ritor1
parents:
diff changeset
4065 memcpy((char *)&v17->cpuid_80000002_registers2[0] + 1, v18, 0x30u);*/
Ritor1
parents:
diff changeset
4066 }
Ritor1
parents:
diff changeset
4067
Ritor1
parents:
diff changeset
4068 //----- (00438F8F) --------------------------------------------------------
783
b27dd658ea77 Taveling by foot fixed.
Nomad
parents: 766
diff changeset
4069 void __cdecl area_of_effect__damage_evaluate()
0
Ritor1
parents:
diff changeset
4070 {
Ritor1
parents:
diff changeset
4071 int v0; // edx@1
Ritor1
parents:
diff changeset
4072 char *v1; // esi@2
Ritor1
parents:
diff changeset
4073 int v2; // ecx@3
Ritor1
parents:
diff changeset
4074 signed int v3; // eax@3
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
4075 SpriteObject *v4; // eax@4
0
Ritor1
parents:
diff changeset
4076 signed int v5; // eax@4
Ritor1
parents:
diff changeset
4077 signed int v6; // eax@6
Ritor1
parents:
diff changeset
4078 unsigned int v7; // edi@6
Ritor1
parents:
diff changeset
4079 int v8; // eax@6
Ritor1
parents:
diff changeset
4080 __int16 v9; // bx@8
Ritor1
parents:
diff changeset
4081 int v10; // edi@8
Ritor1
parents:
diff changeset
4082 Vec3_int_ v11; // ST04_12@9
Ritor1
parents:
diff changeset
4083 int v12; // ST0C_4@10
Ritor1
parents:
diff changeset
4084 Actor *v13; // edi@11
Ritor1
parents:
diff changeset
4085 int v14; // edx@15
Ritor1
parents:
diff changeset
4086 int v15; // edx@15
Ritor1
parents:
diff changeset
4087 int v16; // ebx@15
Ritor1
parents:
diff changeset
4088 signed int v17; // eax@15
Ritor1
parents:
diff changeset
4089 int v18; // edi@15
Ritor1
parents:
diff changeset
4090 int v19; // edi@15
Ritor1
parents:
diff changeset
4091 Vec3_int_ v20; // ST04_12@16
Ritor1
parents:
diff changeset
4092 Vec3_int_ *v21; // eax@17
Ritor1
parents:
diff changeset
4093 unsigned int v22; // edx@17
Ritor1
parents:
diff changeset
4094 int v23; // edx@18
Ritor1
parents:
diff changeset
4095 int v24; // eax@18
Ritor1
parents:
diff changeset
4096 Vec3_int_ v25; // ST04_12@19
Ritor1
parents:
diff changeset
4097 unsigned int v26; // ebx@20
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4098 Player *v27; // edi@20
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
4099 Actor *v28; // edi@27
0
Ritor1
parents:
diff changeset
4100 int v29; // ebx@29
Ritor1
parents:
diff changeset
4101 int v30; // eax@29
Ritor1
parents:
diff changeset
4102 int v31; // edx@29
Ritor1
parents:
diff changeset
4103 int v32; // eax@29
Ritor1
parents:
diff changeset
4104 int v33; // ST24_4@29
Ritor1
parents:
diff changeset
4105 Vec3_int_ v34; // ST04_12@30
Ritor1
parents:
diff changeset
4106 Vec3_int_ *v35; // eax@31
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
4107 SpriteObject *v36; // [sp+0h] [bp-28h]@0
0
Ritor1
parents:
diff changeset
4108 signed int v37; // [sp+4h] [bp-24h]@5
Ritor1
parents:
diff changeset
4109 int v38; // [sp+4h] [bp-24h]@15
Ritor1
parents:
diff changeset
4110 signed int v39; // [sp+8h] [bp-20h]@3
Ritor1
parents:
diff changeset
4111 int v40; // [sp+8h] [bp-20h]@15
Ritor1
parents:
diff changeset
4112 int v41; // [sp+Ch] [bp-1Ch]@5
Ritor1
parents:
diff changeset
4113 int v42; // [sp+Ch] [bp-1Ch]@15
Ritor1
parents:
diff changeset
4114 int v43; // [sp+10h] [bp-18h]@1
Ritor1
parents:
diff changeset
4115 int v44; // [sp+14h] [bp-14h]@15
Ritor1
parents:
diff changeset
4116 unsigned int uActorID; // [sp+18h] [bp-10h]@6
Ritor1
parents:
diff changeset
4117 Vec3_int_ *pVelocity; // [sp+1Ch] [bp-Ch]@2
Ritor1
parents:
diff changeset
4118 int a1; // [sp+20h] [bp-8h]@8
Ritor1
parents:
diff changeset
4119 int v48; // [sp+24h] [bp-4h]@8
Ritor1
parents:
diff changeset
4120
Ritor1
parents:
diff changeset
4121 v0 = 0;
Ritor1
parents:
diff changeset
4122 v43 = 0;
Ritor1
parents:
diff changeset
4123 if ( stru_50FE08.count > 0 )
Ritor1
parents:
diff changeset
4124 {
Ritor1
parents:
diff changeset
4125 pVelocity = &stru_50FE08.vec_4B4;
Ritor1
parents:
diff changeset
4126 v1 = (char *)stru_50FE08.pZs;
Ritor1
parents:
diff changeset
4127 do
Ritor1
parents:
diff changeset
4128 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4129 v2 = PID_TYPE(*((short *)v1 - 300));
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4130 v3 = PID_ID((signed int)*((short *)v1 - 300));
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4131 v39 = PID_ID((signed int)*((short *)v1 - 300));
0
Ritor1
parents:
diff changeset
4132 if ( v2 == 2 )
Ritor1
parents:
diff changeset
4133 {
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
4134 v4 = &pSpriteObjects[v3];
0
Ritor1
parents:
diff changeset
4135 v36 = v4;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
4136 v5 = v4->spell_caster_pid;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4137 v2 = PID_TYPE(v5);
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4138 v3 = PID_ID(v5);
0
Ritor1
parents:
diff changeset
4139 }
Ritor1
parents:
diff changeset
4140 v41 = v2;
Ritor1
parents:
diff changeset
4141 v37 = v3;
Ritor1
parents:
diff changeset
4142 if ( stru_50FE08.field_3EC[v0] & 1 )
Ritor1
parents:
diff changeset
4143 {
417
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
4144 v6 = ai_near_actors_targets_pid[v3];
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4145 v7 = PID_ID(v6);
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4146 v8 = PID_TYPE(v6) - 3;
0
Ritor1
parents:
diff changeset
4147 uActorID = v7;
Ritor1
parents:
diff changeset
4148 if ( v8 )
Ritor1
parents:
diff changeset
4149 {
Ritor1
parents:
diff changeset
4150 if ( v8 == 1 )
Ritor1
parents:
diff changeset
4151 {
Ritor1
parents:
diff changeset
4152 v9 = *(short *)v1;
Ritor1
parents:
diff changeset
4153 v10 = pParty->vPosition.y - *((short *)v1 - 100);
Ritor1
parents:
diff changeset
4154 a1 = pParty->vPosition.x - *((short *)v1 - 200);
Ritor1
parents:
diff changeset
4155 v48 = v10;
Ritor1
parents:
diff changeset
4156 if ( a1 * a1
Ritor1
parents:
diff changeset
4157 + v10 * v10
Ritor1
parents:
diff changeset
4158 + ((signed int)(pParty->vPosition.z + pParty->uPartyHeight) >> (1 - v9))
Ritor1
parents:
diff changeset
4159 * ((signed int)(pParty->vPosition.z + pParty->uPartyHeight) >> (1 - v9)) < (unsigned int)((*((short *)v1 + 100) + 32) * (*((short *)v1 + 100) + 32)) )
Ritor1
parents:
diff changeset
4160 {
Ritor1
parents:
diff changeset
4161 v11.z = *(short *)v1;
Ritor1
parents:
diff changeset
4162 v11.y = *((short *)v1 - 100);
Ritor1
parents:
diff changeset
4163 v11.x = *((short *)v1 - 200);
Ritor1
parents:
diff changeset
4164 if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v11) )
Ritor1
parents:
diff changeset
4165 {
Ritor1
parents:
diff changeset
4166 v12 = stru_50C198.which_player_would_attack(&pActors[v39]);
Ritor1
parents:
diff changeset
4167 DamagePlayerFromMonster(*((short *)v1 - 300), stru_50FE08.field_450[v43], pVelocity, v12);
Ritor1
parents:
diff changeset
4168 }
Ritor1
parents:
diff changeset
4169 }
Ritor1
parents:
diff changeset
4170 }
Ritor1
parents:
diff changeset
4171 }
Ritor1
parents:
diff changeset
4172 else
Ritor1
parents:
diff changeset
4173 {
Ritor1
parents:
diff changeset
4174 v13 = &pActors[v7];
Ritor1
parents:
diff changeset
4175 if ( SHIDWORD(v13->pActorBuffs[6].uExpireTime) > 0
Ritor1
parents:
diff changeset
4176 || SHIDWORD(v13->pActorBuffs[6].uExpireTime) >= 0 && LODWORD(v13->pActorBuffs[6].uExpireTime)
Ritor1
parents:
diff changeset
4177 || v13->CanAct() )
Ritor1
parents:
diff changeset
4178 {
Ritor1
parents:
diff changeset
4179 v14 = v13->vPosition.y;
Ritor1
parents:
diff changeset
4180 v40 = v13->vPosition.x;
Ritor1
parents:
diff changeset
4181 v38 = v14;
Ritor1
parents:
diff changeset
4182 v15 = v14 - *((short *)v1 - 100);
Ritor1
parents:
diff changeset
4183 v16 = *(short *)v1;
Ritor1
parents:
diff changeset
4184 v42 = v13->vPosition.z;
Ritor1
parents:
diff changeset
4185 a1 = v40 - *((short *)v1 - 200);
Ritor1
parents:
diff changeset
4186 v17 = v13->uActorHeight;
Ritor1
parents:
diff changeset
4187 v18 = v13->uActorRadius;
Ritor1
parents:
diff changeset
4188 v44 = v42;
Ritor1
parents:
diff changeset
4189 v19 = *((short *)v1 + 100) + v18;
Ritor1
parents:
diff changeset
4190 v48 = v15;
Ritor1
parents:
diff changeset
4191 if ( a1 * a1 + v15 * v15 + (v42 + (v17 >> 1) - v16) * (v42 + (v17 >> 1) - v16) < (unsigned int)(v19 * v19) )
Ritor1
parents:
diff changeset
4192 {
Ritor1
parents:
diff changeset
4193 v20.z = *(short *)v1;
Ritor1
parents:
diff changeset
4194 v20.y = *((short *)v1 - 100);
Ritor1
parents:
diff changeset
4195 v20.x = *((short *)v1 - 200);
Ritor1
parents:
diff changeset
4196 if ( sub_407A1C(v40, v38, v42 + 50, v20) )
Ritor1
parents:
diff changeset
4197 {
Ritor1
parents:
diff changeset
4198 Vec3_int_::Normalize(&a1, &v48, &v44);
Ritor1
parents:
diff changeset
4199 v21 = pVelocity;
Ritor1
parents:
diff changeset
4200 v22 = uActorID;
Ritor1
parents:
diff changeset
4201 pVelocity->x = a1;
Ritor1
parents:
diff changeset
4202 v21->y = v48;
Ritor1
parents:
diff changeset
4203 v21->z = v44;
Ritor1
parents:
diff changeset
4204 sub_43B1B0(*((short *)v1 - 300), v22, v21, stru_50FE08.field_450[v43]);
Ritor1
parents:
diff changeset
4205 }
Ritor1
parents:
diff changeset
4206 }
Ritor1
parents:
diff changeset
4207 }
Ritor1
parents:
diff changeset
4208 }
Ritor1
parents:
diff changeset
4209 }
Ritor1
parents:
diff changeset
4210 else
Ritor1
parents:
diff changeset
4211 {
Ritor1
parents:
diff changeset
4212 v23 = pParty->vPosition.y - *((short *)v1 - 100);
Ritor1
parents:
diff changeset
4213 v24 = ((signed int)pParty->uPartyHeight >> 1) - *(short *)v1;
Ritor1
parents:
diff changeset
4214 a1 = pParty->vPosition.x - *((short *)v1 - 200);
Ritor1
parents:
diff changeset
4215 v48 = v23;
Ritor1
parents:
diff changeset
4216 if ( a1 * a1 + v23 * v23 + (pParty->vPosition.z + v24) * (pParty->vPosition.z + v24) < (unsigned int)((*((short *)v1 + 100) + 32) * (*((short *)v1 + 100) + 32)) )
Ritor1
parents:
diff changeset
4217 {
Ritor1
parents:
diff changeset
4218 v25.z = *(short *)v1;
Ritor1
parents:
diff changeset
4219 v25.y = *((short *)v1 - 100);
Ritor1
parents:
diff changeset
4220 v25.x = *((short *)v1 - 200);
Ritor1
parents:
diff changeset
4221 if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v25) )
Ritor1
parents:
diff changeset
4222 {
Ritor1
parents:
diff changeset
4223 v26 = 0;
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4224 v27 = pParty->pPlayers;//[0].pConditions[15];
0
Ritor1
parents:
diff changeset
4225 do
Ritor1
parents:
diff changeset
4226 {
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4227 if ( !(HIDWORD(v27->pConditions[14]) | LODWORD(v27->pConditions[14])) && !v27->pConditions[15] && !v27->pConditions[16] )
0
Ritor1
parents:
diff changeset
4228 DamagePlayerFromMonster(*((short *)v1 - 300), stru_50FE08.field_450[v43], pVelocity, v26);
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4229 ++v27;
0
Ritor1
parents:
diff changeset
4230 ++v26;
Ritor1
parents:
diff changeset
4231 }
89
98cd93e14777 pointer fixes
zipi
parents: 82
diff changeset
4232 while ( v27 <= &pParty->pPlayers[3] );
0
Ritor1
parents:
diff changeset
4233 }
Ritor1
parents:
diff changeset
4234 }
Ritor1
parents:
diff changeset
4235 uActorID = 0;
Ritor1
parents:
diff changeset
4236 if ( (signed int)uNumActors > 0 )
Ritor1
parents:
diff changeset
4237 {
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1184
diff changeset
4238 v28 = pActors.data();//[0].vPosition.z;
0
Ritor1
parents:
diff changeset
4239 do
Ritor1
parents:
diff changeset
4240 {
91
471b1354cc73 previous commit fix
zipi
parents: 90
diff changeset
4241 if ( v28->CanAct() )
0
Ritor1
parents:
diff changeset
4242 {
Ritor1
parents:
diff changeset
4243 v29 = *(short *)v1;
91
471b1354cc73 previous commit fix
zipi
parents: 90
diff changeset
4244 v30 = v28->vPosition.y - *((short *)v1 - 100);
471b1354cc73 previous commit fix
zipi
parents: 90
diff changeset
4245 a1 = v28->vPosition.x - *((short *)v1 - 200);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
4246 v31 = v28->vPosition.z;
0
Ritor1
parents:
diff changeset
4247 v48 = v30;
Ritor1
parents:
diff changeset
4248 v44 = v31;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
4249 v32 = (v28->uActorHeight >> 1) - v29;
91
471b1354cc73 previous commit fix
zipi
parents: 90
diff changeset
4250 v33 = v28->uActorRadius + *((short *)v1 + 100);
0
Ritor1
parents:
diff changeset
4251 if ( a1 * a1 + v48 * v48 + (v31 + v32) * (v31 + v32) < (unsigned int)(v33 * v33) )
Ritor1
parents:
diff changeset
4252 {
Ritor1
parents:
diff changeset
4253 v34.z = *(short *)v1;
Ritor1
parents:
diff changeset
4254 v34.y = *((short *)v1 - 100);
Ritor1
parents:
diff changeset
4255 v34.x = *((short *)v1 - 200);
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
4256 if ( sub_407A1C(v28->vPosition.x, v28->vPosition.y, v28->vPosition.z + 50, v34) )
0
Ritor1
parents:
diff changeset
4257 {
Ritor1
parents:
diff changeset
4258 Vec3_int_::Normalize(&a1, &v48, &v44);
Ritor1
parents:
diff changeset
4259 v35 = pVelocity;
Ritor1
parents:
diff changeset
4260 pVelocity->x = a1;
Ritor1
parents:
diff changeset
4261 v35->y = v48;
Ritor1
parents:
diff changeset
4262 v35->z = v44;
Ritor1
parents:
diff changeset
4263 switch ( v41 )
Ritor1
parents:
diff changeset
4264 {
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
4265 case OBJECT_Player:
0
Ritor1
parents:
diff changeset
4266 DamageMonsterFromParty(*((short *)v1 - 300), uActorID, v35);
Ritor1
parents:
diff changeset
4267 break;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
4268 case OBJECT_Actor:
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
4269 if ( v36 && pActors[v37].GetActorsRelation(v28) )
0
Ritor1
parents:
diff changeset
4270 sub_43B1B0(*((short *)v1 - 300), uActorID, pVelocity, v36->field_61);
Ritor1
parents:
diff changeset
4271 break;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
4272 case OBJECT_Item:
0
Ritor1
parents:
diff changeset
4273 sub_43B057(*((short *)v1 - 300), uActorID, v35);
Ritor1
parents:
diff changeset
4274 break;
Ritor1
parents:
diff changeset
4275 }
Ritor1
parents:
diff changeset
4276 }
Ritor1
parents:
diff changeset
4277 }
Ritor1
parents:
diff changeset
4278 }
Ritor1
parents:
diff changeset
4279 ++uActorID;
90
d61f6bc04bf2 more pointer fixes
zipi
parents: 89
diff changeset
4280 ++v28;
0
Ritor1
parents:
diff changeset
4281 }
Ritor1
parents:
diff changeset
4282 while ( (signed int)uActorID < (signed int)uNumActors );
Ritor1
parents:
diff changeset
4283 }
Ritor1
parents:
diff changeset
4284 }
Ritor1
parents:
diff changeset
4285 ++pVelocity;
Ritor1
parents:
diff changeset
4286 v0 = v43 + 1;
Ritor1
parents:
diff changeset
4287 v1 += 2;
Ritor1
parents:
diff changeset
4288 ++v43;
Ritor1
parents:
diff changeset
4289 }
Ritor1
parents:
diff changeset
4290 while ( v43 < stru_50FE08.count );
Ritor1
parents:
diff changeset
4291 }
Ritor1
parents:
diff changeset
4292 stru_50FE08.count = 0;
Ritor1
parents:
diff changeset
4293 }
Ritor1
parents:
diff changeset
4294 // 50FE08: using guessed type stru298 stru_50FE08;
Ritor1
parents:
diff changeset
4295
Ritor1
parents:
diff changeset
4296 // 4D864C: using guessed type char byte_4D864C;
Ritor1
parents:
diff changeset
4297
Ritor1
parents:
diff changeset
4298 //----- (0043A97E) --------------------------------------------------------
Ritor1
parents:
diff changeset
4299 void __fastcall sub_43A97E(unsigned int uLayingItemID, signed int a2)
Ritor1
parents:
diff changeset
4300 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4301 if ( PID_TYPE(a2) == OBJECT_BLVDoor)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4302 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4303 layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x;
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4304 layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y;
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4305 layingitem_vel_50FDFC.z = pSpriteObjects[uLayingItemID].vVelocity.z;
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4306
0
Ritor1
parents:
diff changeset
4307 Vec3_int_::Normalize(&layingitem_vel_50FDFC.x, &layingitem_vel_50FDFC.y, &layingitem_vel_50FDFC.z);
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4308 DamagePlayerFromMonster(PID(OBJECT_Item, uLayingItemID), pSpriteObjects[uLayingItemID].field_61, &layingitem_vel_50FDFC, 0xFFFFFFFFu);
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4309 }
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4310 else if (PID_TYPE(a2) == OBJECT_Actor)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4311 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4312 layingitem_vel_50FDFC.x = pSpriteObjects[uLayingItemID].vVelocity.x;
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4313 layingitem_vel_50FDFC.y = pSpriteObjects[uLayingItemID].vVelocity.y;
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4314 layingitem_vel_50FDFC.z = pSpriteObjects[uLayingItemID].vVelocity.z;
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4315
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4316 Vec3_int_::Normalize(&layingitem_vel_50FDFC.x, &layingitem_vel_50FDFC.y, &layingitem_vel_50FDFC.z);
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4317 switch (PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid))
0
Ritor1
parents:
diff changeset
4318 {
Ritor1
parents:
diff changeset
4319 case OBJECT_Actor:
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4320 sub_43B1B0(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC, pSpriteObjects[uLayingItemID].field_61);
0
Ritor1
parents:
diff changeset
4321 break;
Ritor1
parents:
diff changeset
4322 case OBJECT_Player:
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4323 DamageMonsterFromParty(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC);
0
Ritor1
parents:
diff changeset
4324 break;
Ritor1
parents:
diff changeset
4325 case OBJECT_Item:
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4326 sub_43B057(PID(OBJECT_Item, uLayingItemID), PID_ID(a2), &layingitem_vel_50FDFC);
0
Ritor1
parents:
diff changeset
4327 break;
Ritor1
parents:
diff changeset
4328 }
Ritor1
parents:
diff changeset
4329 }
Ritor1
parents:
diff changeset
4330 }
Ritor1
parents:
diff changeset
4331
Ritor1
parents:
diff changeset
4332 //----- (0043AA99) --------------------------------------------------------
Ritor1
parents:
diff changeset
4333 void __fastcall Vec3_int_::Rotate(int sDepth, int sRotY, int sRotX, Vec3_int_ v, int *outx, int *outy, int *outz)
Ritor1
parents:
diff changeset
4334 {
147
c70fea5013aa 12.02.13
Ritor1
parents: 146
diff changeset
4335 float cosf_x = cosf(3.14159265f * sRotX / 1024.0f),
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
4336 sinf_x = sinf(3.14159265f * sRotX / 1024.0f),
147
c70fea5013aa 12.02.13
Ritor1
parents: 146
diff changeset
4337 cosf_y = cosf(3.14159265f * sRotY / 1024.0f),
c70fea5013aa 12.02.13
Ritor1
parents: 146
diff changeset
4338 sinf_y = sinf(3.14159265f * sRotY / 1024.0f);
1045
d3f4c6584ada Intersect_Ray_Face clean
Ritor1
parents: 1029
diff changeset
4339
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
4340 *outx = v.x + ((unsigned __int64)(sinf_y * (signed __int64)((unsigned __int64)(cosf_x * (signed __int64)sDepth)>> 16)));
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
4341 *outy = v.y + ((unsigned __int64)(cosf_y * (signed __int64)((unsigned __int64)(cosf_x * (signed __int64)sDepth)>> 16)));
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
4342 *outz = v.z + ((unsigned __int64)(sinf_x * (signed __int64)sDepth) >> 16);
0
Ritor1
parents:
diff changeset
4343 }
Ritor1
parents:
diff changeset
4344
Ritor1
parents:
diff changeset
4345 //----- (0043AB61) --------------------------------------------------------
Ritor1
parents:
diff changeset
4346 void Vec3_int_::Normalize(int *x, int *y, int *z)
Ritor1
parents:
diff changeset
4347 {
1025
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
4348 *x *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
4349 *y *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1);
8b492d4722d4 Intersection
Ritor1
parents: 1023
diff changeset
4350 *z *= 65536 / (integer_sqrt(*y * *y + *z * *z + *x * *x) | 1);
0
Ritor1
parents:
diff changeset
4351 }
Ritor1
parents:
diff changeset
4352
Ritor1
parents:
diff changeset
4353 //----- (0043AE12) --------------------------------------------------------
Ritor1
parents:
diff changeset
4354 double __fastcall sub_43AE12(signed int a1)
Ritor1
parents:
diff changeset
4355 {
Ritor1
parents:
diff changeset
4356 signed int v1; // ST00_4@1
Ritor1
parents:
diff changeset
4357 signed int v2; // ecx@1
Ritor1
parents:
diff changeset
4358 double v3; // st7@1
Ritor1
parents:
diff changeset
4359 double result; // st7@6
Ritor1
parents:
diff changeset
4360
Ritor1
parents:
diff changeset
4361 v1 = a1;
Ritor1
parents:
diff changeset
4362 v2 = 0;
Ritor1
parents:
diff changeset
4363 v3 = (double)v1;
Ritor1
parents:
diff changeset
4364 do
Ritor1
parents:
diff changeset
4365 {
Ritor1
parents:
diff changeset
4366 if ( v3 < flt_4E4A80[v2 + 5] )
Ritor1
parents:
diff changeset
4367 break;
Ritor1
parents:
diff changeset
4368 ++v2;
Ritor1
parents:
diff changeset
4369 }
Ritor1
parents:
diff changeset
4370 while ( v2 < 5 );
Ritor1
parents:
diff changeset
4371 if ( v2 <= 0 || v2 >= 5 )
Ritor1
parents:
diff changeset
4372 {
Ritor1
parents:
diff changeset
4373 if ( v2 )
Ritor1
parents:
diff changeset
4374 result = flt_4E4A80[4];
Ritor1
parents:
diff changeset
4375 else
Ritor1
parents:
diff changeset
4376 result = flt_4E4A80[0];
Ritor1
parents:
diff changeset
4377 }
Ritor1
parents:
diff changeset
4378 else
Ritor1
parents:
diff changeset
4379 {
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
4380 result = (flt_4E4A80[v2] - flt_4E4A80[v2 - 3]) * (v3 - flt_4E4A80[v2 + 4]) / (flt_4E4A80[v2 + 5] - flt_4E4A80[v2 + 4]) + flt_4E4A80[v2];
0
Ritor1
parents:
diff changeset
4381 }
Ritor1
parents:
diff changeset
4382 return result;
Ritor1
parents:
diff changeset
4383 }
Ritor1
parents:
diff changeset
4384
Ritor1
parents:
diff changeset
4385 //----- (0043B057) --------------------------------------------------------
Ritor1
parents:
diff changeset
4386 void __fastcall sub_43B057(unsigned int uObjID, unsigned int uActorID, Vec3_int_ *pVelocity)
Ritor1
parents:
diff changeset
4387 {
Ritor1
parents:
diff changeset
4388 Actor *pActor; // esi@1
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
4389 SpriteObject *v4; // eax@3
0
Ritor1
parents:
diff changeset
4390 int v5; // ecx@3
Ritor1
parents:
diff changeset
4391 int v6; // eax@4
Ritor1
parents:
diff changeset
4392 int v7; // edi@4
Ritor1
parents:
diff changeset
4393 unsigned int uActorIDa; // [sp+8h] [bp-8h]@1
Ritor1
parents:
diff changeset
4394 unsigned int a2; // [sp+Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
4395 int a2a; // [sp+Ch] [bp-4h]@8
Ritor1
parents:
diff changeset
4396
Ritor1
parents:
diff changeset
4397 uActorIDa = uActorID;
Ritor1
parents:
diff changeset
4398 pActor = &pActors[uActorID];
Ritor1
parents:
diff changeset
4399 a2 = uObjID;
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
4400 if ( !pActors[uActorID].IsNotAlive() )
0
Ritor1
parents:
diff changeset
4401 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4402 if ( PID_TYPE(a2) == OBJECT_Item)
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4403 {
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4404 v4 = &pSpriteObjects[PID_ID(a2)];
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
4405 v5 = v4->spell_id;
0
Ritor1
parents:
diff changeset
4406 if ( v5 )
Ritor1
parents:
diff changeset
4407 {
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
4408 v6 = _43AFE3_calc_spell_damage(v5, v4->spell_level, v4->spell_skill, pActor->sCurrentHP);
0
Ritor1
parents:
diff changeset
4409 v7 = stru_50C198.CalcMagicalDamageToActor(pActor, 0, v6);
Ritor1
parents:
diff changeset
4410 pActor->sCurrentHP -= v7;
Ritor1
parents:
diff changeset
4411 if ( v7 )
Ritor1
parents:
diff changeset
4412 {
Ritor1
parents:
diff changeset
4413 if ( pActor->sCurrentHP > 0 )
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
4414 Actor::AI_Stun(uActorIDa, a2, 0);
0
Ritor1
parents:
diff changeset
4415 else
Ritor1
parents:
diff changeset
4416 Actor::Die(uActorIDa);
Ritor1
parents:
diff changeset
4417 a2a = 20 * v7 / (signed int)pActor->pMonsterInfo.uHP;
Ritor1
parents:
diff changeset
4418 if ( 20 * v7 / (signed int)pActor->pMonsterInfo.uHP > 10 )
Ritor1
parents:
diff changeset
4419 a2a = 10;
Ritor1
parents:
diff changeset
4420 if ( !MonsterStats::BelongsToSupertype(pActor->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) )
Ritor1
parents:
diff changeset
4421 {
Ritor1
parents:
diff changeset
4422 pVelocity->x = (unsigned __int64)(a2a * (signed __int64)pVelocity->x) >> 16;
Ritor1
parents:
diff changeset
4423 pVelocity->y = (unsigned __int64)(a2a * (signed __int64)pVelocity->y) >> 16;
Ritor1
parents:
diff changeset
4424 pVelocity->z = (unsigned __int64)(a2a * (signed __int64)pVelocity->z) >> 16;
Ritor1
parents:
diff changeset
4425 pActor->vVelocity.x = 50 * LOWORD(pVelocity->x);
Ritor1
parents:
diff changeset
4426 pActor->vVelocity.y = 50 * LOWORD(pVelocity->y);
Ritor1
parents:
diff changeset
4427 pActor->vVelocity.z = 50 * LOWORD(pVelocity->z);
Ritor1
parents:
diff changeset
4428 }
Ritor1
parents:
diff changeset
4429 Actor::AddBloodsplatOnDamageOverlay(uActorIDa, 1, v7);
Ritor1
parents:
diff changeset
4430 }
Ritor1
parents:
diff changeset
4431 else
Ritor1
parents:
diff changeset
4432 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
4433 Actor::AI_Stun(uActorIDa, a2, 0);
0
Ritor1
parents:
diff changeset
4434 }
Ritor1
parents:
diff changeset
4435 }
Ritor1
parents:
diff changeset
4436 }
Ritor1
parents:
diff changeset
4437 }
Ritor1
parents:
diff changeset
4438 }
Ritor1
parents:
diff changeset
4439
Ritor1
parents:
diff changeset
4440 //----- (0043B1B0) --------------------------------------------------------
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
4441 void sub_43B1B0(signed int a1, unsigned int a2, Vec3_int_ *pVelocity, signed int a4)
0
Ritor1
parents:
diff changeset
4442 {
Ritor1
parents:
diff changeset
4443 int v4; // ebx@1
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
4444 SpriteObject *v5; // eax@2
0
Ritor1
parents:
diff changeset
4445 bool v6; // eax@3
Ritor1
parents:
diff changeset
4446 Actor *v7; // esi@4
Ritor1
parents:
diff changeset
4447 Actor *v8; // edi@4
Ritor1
parents:
diff changeset
4448 char v9; // zf@5
Ritor1
parents:
diff changeset
4449 __int64 v10; // qax@8
Ritor1
parents:
diff changeset
4450 signed __int16 v11; // cx@9
Ritor1
parents:
diff changeset
4451 signed int v12; // ecx@20
Ritor1
parents:
diff changeset
4452 int v13; // ecx@22
Ritor1
parents:
diff changeset
4453 int v14; // edi@30
Ritor1
parents:
diff changeset
4454 unsigned int uActorID; // [sp+Ch] [bp-8h]@1
Ritor1
parents:
diff changeset
4455 signed int v17; // [sp+10h] [bp-4h]@1
Ritor1
parents:
diff changeset
4456 int v18; // [sp+20h] [bp+Ch]@34
Ritor1
parents:
diff changeset
4457
Ritor1
parents:
diff changeset
4458 v4 = 0;
Ritor1
parents:
diff changeset
4459 uActorID = a2;
Ritor1
parents:
diff changeset
4460 v17 = a1;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4461 if ( PID_TYPE(a1) == OBJECT_Item)
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4462 {
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4463 v5 = &pSpriteObjects[PID_ID(a1)];
0
Ritor1
parents:
diff changeset
4464 v4 = v5->field_60_distance_related_prolly_lod;
822
c232f160e6f3 Named SpriteObject spell-related fields.
Nomad
parents: 819
diff changeset
4465 v17 = v5->spell_caster_pid;
0
Ritor1
parents:
diff changeset
4466 }
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4467 LOWORD(v6) = PID_TYPE(v17);
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
4468 if ( v6 == OBJECT_Actor)
0
Ritor1
parents:
diff changeset
4469 {
Ritor1
parents:
diff changeset
4470 v7 = &pActors[a2];
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4471 v8 = &pActors[PID_ID(v17)];
303
3dcc9d945eeb DamageMonsterFromParty
Nomad
parents: 296
diff changeset
4472 v6 = pActors[a2].IsNotAlive();
0
Ritor1
parents:
diff changeset
4473 if ( !v6 )
Ritor1
parents:
diff changeset
4474 {
Ritor1
parents:
diff changeset
4475 v9 = v7->uAIState == 7;
Ritor1
parents:
diff changeset
4476 v7->uLastCharacterIDToHit = v17;
Ritor1
parents:
diff changeset
4477 if ( v9 )
Ritor1
parents:
diff changeset
4478 BYTE2(v7->uAttributes) |= 2u;
Ritor1
parents:
diff changeset
4479 v6 = stru_50C198._4273BB(v8, v7, v4, 0);
Ritor1
parents:
diff changeset
4480 if ( v6 )
Ritor1
parents:
diff changeset
4481 {
Ritor1
parents:
diff changeset
4482 v10 = (unsigned int)Actor::_43B3E0_CalcDamage(v8, a4);
Ritor1
parents:
diff changeset
4483 if ( (signed __int64)v8->pActorBuffs[3].uExpireTime > 0 )
Ritor1
parents:
diff changeset
4484 {
Ritor1
parents:
diff changeset
4485 v11 = v8->pActorBuffs[3].uPower;
Ritor1
parents:
diff changeset
4486 if ( v11 )
Ritor1
parents:
diff changeset
4487 v10 = (signed int)v10 / (unsigned __int16)v11;
Ritor1
parents:
diff changeset
4488 }
Ritor1
parents:
diff changeset
4489 if ( SHIDWORD(v7->pActorBuffs[5].uExpireTime) >= SHIDWORD(v10)
Ritor1
parents:
diff changeset
4490 && (SHIDWORD(v7->pActorBuffs[5].uExpireTime) > SHIDWORD(v10)
Ritor1
parents:
diff changeset
4491 || LODWORD(v7->pActorBuffs[5].uExpireTime) > HIDWORD(v10)) )
Ritor1
parents:
diff changeset
4492 LODWORD(v10) = 0;
Ritor1
parents:
diff changeset
4493 if ( a4 != HIDWORD(v10) )
Ritor1
parents:
diff changeset
4494 {
Ritor1
parents:
diff changeset
4495 if ( a4 - HIDWORD(v10) == 1 )
Ritor1
parents:
diff changeset
4496 {
Ritor1
parents:
diff changeset
4497 v12 = v8->pMonsterInfo.uAttack2Type;
Ritor1
parents:
diff changeset
4498 if ( SHIDWORD(v7->pActorBuffs[15].uExpireTime) >= SHIDWORD(v10)
Ritor1
parents:
diff changeset
4499 && (SHIDWORD(v7->pActorBuffs[15].uExpireTime) > SHIDWORD(v10)
Ritor1
parents:
diff changeset
4500 || LODWORD(v7->pActorBuffs[15].uExpireTime) > HIDWORD(v10)) )
Ritor1
parents:
diff changeset
4501 LODWORD(v10) = (signed int)v10 >> 1;
Ritor1
parents:
diff changeset
4502 goto LABEL_30;
Ritor1
parents:
diff changeset
4503 }
Ritor1
parents:
diff changeset
4504 if ( a4 - HIDWORD(v10) == 2 )
Ritor1
parents:
diff changeset
4505 {
Ritor1
parents:
diff changeset
4506 v13 = v7->pMonsterInfo.uSpell1ID;
Ritor1
parents:
diff changeset
4507 }
Ritor1
parents:
diff changeset
4508 else
Ritor1
parents:
diff changeset
4509 {
Ritor1
parents:
diff changeset
4510 if ( a4 - HIDWORD(v10) != 3 )
Ritor1
parents:
diff changeset
4511 {
Ritor1
parents:
diff changeset
4512 if ( a4 - HIDWORD(v10) == 4 )
Ritor1
parents:
diff changeset
4513 v12 = v8->pMonsterInfo.field_3C_some_special_attack;
Ritor1
parents:
diff changeset
4514 else
Ritor1
parents:
diff changeset
4515 v12 = 4;
Ritor1
parents:
diff changeset
4516 LABEL_30:
Ritor1
parents:
diff changeset
4517 v14 = stru_50C198.CalcMagicalDamageToActor(v7, v12, v10);
Ritor1
parents:
diff changeset
4518 v7->sCurrentHP -= v14;
Ritor1
parents:
diff changeset
4519 if ( v14 )
Ritor1
parents:
diff changeset
4520 {
Ritor1
parents:
diff changeset
4521 if ( v7->sCurrentHP > 0 )
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
4522 Actor::AI_Stun(uActorID, v17, 0);
0
Ritor1
parents:
diff changeset
4523 else
Ritor1
parents:
diff changeset
4524 Actor::Die(uActorID);
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
4525 Actor::AggroSurroundingPeasants(uActorID, 0);
0
Ritor1
parents:
diff changeset
4526 v18 = 20 * v14 / (signed int)v7->pMonsterInfo.uHP;
Ritor1
parents:
diff changeset
4527 if ( 20 * v14 / (signed int)v7->pMonsterInfo.uHP > 10 )
Ritor1
parents:
diff changeset
4528 v18 = 10;
Ritor1
parents:
diff changeset
4529 if ( !MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) )
Ritor1
parents:
diff changeset
4530 {
Ritor1
parents:
diff changeset
4531 pVelocity->x = (unsigned __int64)(v18 * (signed __int64)pVelocity->x) >> 16;
Ritor1
parents:
diff changeset
4532 pVelocity->y = (unsigned __int64)(v18 * (signed __int64)pVelocity->y) >> 16;
Ritor1
parents:
diff changeset
4533 pVelocity->z = (unsigned __int64)(v18 * (signed __int64)pVelocity->z) >> 16;
Ritor1
parents:
diff changeset
4534 v7->vVelocity.x = 50 * LOWORD(pVelocity->x);
Ritor1
parents:
diff changeset
4535 v7->vVelocity.y = 50 * LOWORD(pVelocity->y);
Ritor1
parents:
diff changeset
4536 v7->vVelocity.z = 50 * LOWORD(pVelocity->z);
Ritor1
parents:
diff changeset
4537 }
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
4538 Actor::AddBloodsplatOnDamageOverlay(uActorID, 1, v14);
0
Ritor1
parents:
diff changeset
4539 }
Ritor1
parents:
diff changeset
4540 else
Ritor1
parents:
diff changeset
4541 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
4542 Actor::AI_Stun(uActorID, v17, 0);
0
Ritor1
parents:
diff changeset
4543 }
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
4544 return;
0
Ritor1
parents:
diff changeset
4545 }
Ritor1
parents:
diff changeset
4546 v13 = v7->pMonsterInfo.uSpell2ID;
Ritor1
parents:
diff changeset
4547 }
Ritor1
parents:
diff changeset
4548 v12 = LOBYTE(pSpellStats->pInfos[v13].uSchool);
Ritor1
parents:
diff changeset
4549 goto LABEL_30;
Ritor1
parents:
diff changeset
4550 }
Ritor1
parents:
diff changeset
4551 v12 = v8->pMonsterInfo.uAttack1Type;
Ritor1
parents:
diff changeset
4552 goto LABEL_30;
Ritor1
parents:
diff changeset
4553 }
Ritor1
parents:
diff changeset
4554 }
Ritor1
parents:
diff changeset
4555 }
Ritor1
parents:
diff changeset
4556 }
Ritor1
parents:
diff changeset
4557
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
4558 // A750D8: using guessed type __int64 qword_A750D8;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
4559
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
4560
0
Ritor1
parents:
diff changeset
4561 // A750D8: using guessed type __int64 qword_A750D8;
Ritor1
parents:
diff changeset
4562
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1296
diff changeset
4563
0
Ritor1
parents:
diff changeset
4564 // A750D8: using guessed type __int64 qword_A750D8;
Ritor1
parents:
diff changeset
4565
Ritor1
parents:
diff changeset
4566 //----- (0043F515) --------------------------------------------------------
657
7747161ea5b5 RenderBillboard member rename
Nomad
parents: 651
diff changeset
4567 void FindBillboardsLightLevels_BLV()
0
Ritor1
parents:
diff changeset
4568 {
Ritor1
parents:
diff changeset
4569 for (uint i = 0; i < uNumBillboardsToDraw; ++i)
Ritor1
parents:
diff changeset
4570 {
1206
ab6560001f5b arrays to std::arrays phase 2 - some more arrays converted
Grumpy7
parents: 1205
diff changeset
4571 auto p = &pBillboardRenderList[i];
0
Ritor1
parents:
diff changeset
4572
Ritor1
parents:
diff changeset
4573 if (p->field_1E & 2 || uCurrentlyLoadedLevelType == LEVEL_Indoor && !p->uIndoorSectorID)
657
7747161ea5b5 RenderBillboard member rename
Nomad
parents: 651
diff changeset
4574 p->dimming_level = 0;
0
Ritor1
parents:
diff changeset
4575 else
657
7747161ea5b5 RenderBillboard member rename
Nomad
parents: 651
diff changeset
4576 p->dimming_level = _43F55F_get_billboard_light_level(p, -1);
0
Ritor1
parents:
diff changeset
4577 }
Ritor1
parents:
diff changeset
4578 }
Ritor1
parents:
diff changeset
4579
Ritor1
parents:
diff changeset
4580 //----- (0043F55F) --------------------------------------------------------
Ritor1
parents:
diff changeset
4581 int __fastcall _43F55F_get_billboard_light_level(RenderBillboard *a1, int uBaseLightLevel)
Ritor1
parents:
diff changeset
4582 {
Ritor1
parents:
diff changeset
4583 signed int v3; // ecx@2
Ritor1
parents:
diff changeset
4584
Ritor1
parents:
diff changeset
4585 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
Ritor1
parents:
diff changeset
4586 {
Ritor1
parents:
diff changeset
4587 v3 = pIndoor->pSectors[a1->uIndoorSectorID].uMinAmbientLightLevel;
Ritor1
parents:
diff changeset
4588 }
Ritor1
parents:
diff changeset
4589 else
Ritor1
parents:
diff changeset
4590 {
Ritor1
parents:
diff changeset
4591 if ( uBaseLightLevel == -1 )
657
7747161ea5b5 RenderBillboard member rename
Nomad
parents: 651
diff changeset
4592 v3 = a1->dimming_level;
0
Ritor1
parents:
diff changeset
4593 else
Ritor1
parents:
diff changeset
4594 v3 = uBaseLightLevel;
Ritor1
parents:
diff changeset
4595 }
430
58b71c1af7d8 Objects are drawn (items, spells sfx)
Nomad
parents: 417
diff changeset
4596 return _43F5C8_get_point_light_level_with_respect_to_lights(v3, a1->uIndoorSectorID, a1->world_x, a1->world_y, a1->world_z);
0
Ritor1
parents:
diff changeset
4597 }
Ritor1
parents:
diff changeset
4598
Ritor1
parents:
diff changeset
4599 //----- (0043F5C8) --------------------------------------------------------
Ritor1
parents:
diff changeset
4600 int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z)
Ritor1
parents:
diff changeset
4601 {
Ritor1
parents:
diff changeset
4602 int v5; // esi@1
Ritor1
parents:
diff changeset
4603 signed int v6; // edi@1
Ritor1
parents:
diff changeset
4604 int v8; // eax@6
Ritor1
parents:
diff changeset
4605 int v9; // ebx@6
Ritor1
parents:
diff changeset
4606 unsigned int v10; // ecx@6
Ritor1
parents:
diff changeset
4607 unsigned int v11; // edx@9
Ritor1
parents:
diff changeset
4608 unsigned int v12; // edx@11
Ritor1
parents:
diff changeset
4609 signed int v13; // ecx@12
Ritor1
parents:
diff changeset
4610 BLVLightMM7 *v16; // esi@20
Ritor1
parents:
diff changeset
4611 int v17; // ebx@21
Ritor1
parents:
diff changeset
4612 int v18; // eax@24
Ritor1
parents:
diff changeset
4613 int v19; // ebx@24
Ritor1
parents:
diff changeset
4614 unsigned int v20; // ecx@24
Ritor1
parents:
diff changeset
4615 int v21; // edx@25
Ritor1
parents:
diff changeset
4616 unsigned int v22; // edx@27
Ritor1
parents:
diff changeset
4617 unsigned int v23; // edx@29
Ritor1
parents:
diff changeset
4618 signed int v24; // ecx@30
Ritor1
parents:
diff changeset
4619 int v26; // ebx@35
Ritor1
parents:
diff changeset
4620 int v27; // eax@38
Ritor1
parents:
diff changeset
4621 int v28; // ebx@38
Ritor1
parents:
diff changeset
4622 unsigned int v29; // ecx@38
Ritor1
parents:
diff changeset
4623 int v30; // edx@39
Ritor1
parents:
diff changeset
4624 unsigned int v31; // edx@41
Ritor1
parents:
diff changeset
4625 unsigned int v32; // edx@43
Ritor1
parents:
diff changeset
4626 signed int v33; // ecx@44
Ritor1
parents:
diff changeset
4627 int v37; // [sp+Ch] [bp-18h]@37
Ritor1
parents:
diff changeset
4628 int v38; // [sp+10h] [bp-14h]@5
Ritor1
parents:
diff changeset
4629 int v39; // [sp+10h] [bp-14h]@23
Ritor1
parents:
diff changeset
4630 int v40; // [sp+10h] [bp-14h]@36
Ritor1
parents:
diff changeset
4631 int v42; // [sp+14h] [bp-10h]@22
Ritor1
parents:
diff changeset
4632 unsigned int v43; // [sp+18h] [bp-Ch]@12
Ritor1
parents:
diff changeset
4633 unsigned int v44; // [sp+18h] [bp-Ch]@30
Ritor1
parents:
diff changeset
4634 unsigned int v45; // [sp+18h] [bp-Ch]@44
Ritor1
parents:
diff changeset
4635
Ritor1
parents:
diff changeset
4636 v6 = uBaseLightLevel;
Ritor1
parents:
diff changeset
4637 for (uint i = 0; i < pMobileLightsStack->uNumLightsActive; ++i)
Ritor1
parents:
diff changeset
4638 {
Ritor1
parents:
diff changeset
4639 auto p = pMobileLightsStack->pLights + i;
Ritor1
parents:
diff changeset
4640
Ritor1
parents:
diff changeset
4641 auto distX = abs(p->vPosition.x - x);
Ritor1
parents:
diff changeset
4642 if ( distX <= p->uRadius)
Ritor1
parents:
diff changeset
4643 {
Ritor1
parents:
diff changeset
4644 auto distY = abs(p->vPosition.y - y);
Ritor1
parents:
diff changeset
4645 if ( distY <= p->uRadius)
Ritor1
parents:
diff changeset
4646 {
Ritor1
parents:
diff changeset
4647 auto distZ = abs(p->vPosition.z - z);
Ritor1
parents:
diff changeset
4648 if ( distZ <= p->uRadius)
Ritor1
parents:
diff changeset
4649 {
Ritor1
parents:
diff changeset
4650 v8 = distX;
Ritor1
parents:
diff changeset
4651 v9 = distY;
Ritor1
parents:
diff changeset
4652 v10 = distZ;
Ritor1
parents:
diff changeset
4653 if (distX < distY)
Ritor1
parents:
diff changeset
4654 {
Ritor1
parents:
diff changeset
4655 v8 = distY;
Ritor1
parents:
diff changeset
4656 v9 = distX;
Ritor1
parents:
diff changeset
4657 }
Ritor1
parents:
diff changeset
4658 if ( v8 < distZ )
Ritor1
parents:
diff changeset
4659 {
Ritor1
parents:
diff changeset
4660 v11 = v8;
Ritor1
parents:
diff changeset
4661 v8 = distZ;
Ritor1
parents:
diff changeset
4662 v10 = v11;
Ritor1
parents:
diff changeset
4663 }
Ritor1
parents:
diff changeset
4664 if ( v9 < (signed int)v10 )
Ritor1
parents:
diff changeset
4665 {
Ritor1
parents:
diff changeset
4666 v12 = v10;
Ritor1
parents:
diff changeset
4667 v10 = v9;
Ritor1
parents:
diff changeset
4668 v9 = v12;
Ritor1
parents:
diff changeset
4669 }
Ritor1
parents:
diff changeset
4670 v43 = ((unsigned int)(11 * v9) / 32) + (v10 / 4) + v8;
Ritor1
parents:
diff changeset
4671 v13 = p->uRadius;
Ritor1
parents:
diff changeset
4672 if ( (signed int)v43 < v13 )
Ritor1
parents:
diff changeset
4673 v6 += ((unsigned __int64)(30i64 * (signed int)(v43 << 16) / v13) >> 16) - 30;
Ritor1
parents:
diff changeset
4674 }
Ritor1
parents:
diff changeset
4675 }
Ritor1
parents:
diff changeset
4676 }
Ritor1
parents:
diff changeset
4677 }
Ritor1
parents:
diff changeset
4678
Ritor1
parents:
diff changeset
4679 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor)
Ritor1
parents:
diff changeset
4680 {
Ritor1
parents:
diff changeset
4681 auto pSector = pIndoor->pSectors + uSectorID;
Ritor1
parents:
diff changeset
4682
Ritor1
parents:
diff changeset
4683 for (uint i = 0; i < pSector->uNumLights; ++i)
Ritor1
parents:
diff changeset
4684 {
Ritor1
parents:
diff changeset
4685 v16 = pIndoor->pLights + pSector->pLights[i];
Ritor1
parents:
diff changeset
4686 if (~v16->uAtributes & 8)
Ritor1
parents:
diff changeset
4687 {
Ritor1
parents:
diff changeset
4688 v17 = abs(v16->vPosition.x - x);
Ritor1
parents:
diff changeset
4689 if ( v17 <= v16->uRadius )
Ritor1
parents:
diff changeset
4690 {
Ritor1
parents:
diff changeset
4691 v42 = abs(v16->vPosition.y - y);
Ritor1
parents:
diff changeset
4692 if ( v42 <= v16->uRadius )
Ritor1
parents:
diff changeset
4693 {
Ritor1
parents:
diff changeset
4694 v39 = abs(v16->vPosition.z - z);
Ritor1
parents:
diff changeset
4695 if ( v39 <= v16->uRadius )
Ritor1
parents:
diff changeset
4696 {
Ritor1
parents:
diff changeset
4697 v18 = v17;
Ritor1
parents:
diff changeset
4698 v19 = v42;
Ritor1
parents:
diff changeset
4699 v20 = v39;
Ritor1
parents:
diff changeset
4700 if ( v18 < v42 )
Ritor1
parents:
diff changeset
4701 {
Ritor1
parents:
diff changeset
4702 v21 = v18;
Ritor1
parents:
diff changeset
4703 v18 = v42;
Ritor1
parents:
diff changeset
4704 v19 = v21;
Ritor1
parents:
diff changeset
4705 }
Ritor1
parents:
diff changeset
4706 if ( v18 < v39 )
Ritor1
parents:
diff changeset
4707 {
Ritor1
parents:
diff changeset
4708 v22 = v18;
Ritor1
parents:
diff changeset
4709 v18 = v39;
Ritor1
parents:
diff changeset
4710 v20 = v22;
Ritor1
parents:
diff changeset
4711 }
Ritor1
parents:
diff changeset
4712 if ( v19 < (signed int)v20 )
Ritor1
parents:
diff changeset
4713 {
Ritor1
parents:
diff changeset
4714 v23 = v20;
Ritor1
parents:
diff changeset
4715 v20 = v19;
Ritor1
parents:
diff changeset
4716 v19 = v23;
Ritor1
parents:
diff changeset
4717 }
Ritor1
parents:
diff changeset
4718 v44 = ((unsigned int)(11 * v19) >> 5) + (v20 >> 2) + v18;
Ritor1
parents:
diff changeset
4719 v24 = v16->uRadius;
Ritor1
parents:
diff changeset
4720 if ( (signed int)v44 < v24 )
Ritor1
parents:
diff changeset
4721 v6 += ((unsigned __int64)(30i64 * (signed int)(v44 << 16) / v24) >> 16) - 30;
Ritor1
parents:
diff changeset
4722 }
Ritor1
parents:
diff changeset
4723 }
Ritor1
parents:
diff changeset
4724 }
Ritor1
parents:
diff changeset
4725 }
Ritor1
parents:
diff changeset
4726 }
Ritor1
parents:
diff changeset
4727 }
Ritor1
parents:
diff changeset
4728
Ritor1
parents:
diff changeset
4729 for (uint i = 0; i < pStationaryLightsStack->uNumLightsActive; ++i)
Ritor1
parents:
diff changeset
4730 {
Ritor1
parents:
diff changeset
4731 auto p = pStationaryLightsStack->pLights + i;
Ritor1
parents:
diff changeset
4732 v26 = abs(p->vPosition.x - x);
Ritor1
parents:
diff changeset
4733 if ( v26 <= p->uRadius)
Ritor1
parents:
diff changeset
4734 {
Ritor1
parents:
diff changeset
4735 v40 = abs(p->vPosition.y - y);
Ritor1
parents:
diff changeset
4736 if ( v40 <= p->uRadius)
Ritor1
parents:
diff changeset
4737 {
Ritor1
parents:
diff changeset
4738 v37 = abs(p->vPosition.z - z);
Ritor1
parents:
diff changeset
4739 if ( v37 <= p->uRadius)
Ritor1
parents:
diff changeset
4740 {
Ritor1
parents:
diff changeset
4741 v27 = v26;
Ritor1
parents:
diff changeset
4742 v28 = v40;
Ritor1
parents:
diff changeset
4743 v29 = v37;
Ritor1
parents:
diff changeset
4744 if ( v27 < v40 )
Ritor1
parents:
diff changeset
4745 {
Ritor1
parents:
diff changeset
4746 v30 = v27;
Ritor1
parents:
diff changeset
4747 v27 = v40;
Ritor1
parents:
diff changeset
4748 v28 = v30;
Ritor1
parents:
diff changeset
4749 }
Ritor1
parents:
diff changeset
4750 if ( v27 < v37 )
Ritor1
parents:
diff changeset
4751 {
Ritor1
parents:
diff changeset
4752 v31 = v27;
Ritor1
parents:
diff changeset
4753 v27 = v37;
Ritor1
parents:
diff changeset
4754 v29 = v31;
Ritor1
parents:
diff changeset
4755 }
Ritor1
parents:
diff changeset
4756 if ( v28 < (signed int)v29 )
Ritor1
parents:
diff changeset
4757 {
Ritor1
parents:
diff changeset
4758 v32 = v29;
Ritor1
parents:
diff changeset
4759 v29 = v28;
Ritor1
parents:
diff changeset
4760 v28 = v32;
Ritor1
parents:
diff changeset
4761 }
Ritor1
parents:
diff changeset
4762 v45 = ((unsigned int)(11 * v28) >> 5) + (v29 >> 2) + v27;
Ritor1
parents:
diff changeset
4763 v33 = p->uRadius;
Ritor1
parents:
diff changeset
4764 if ( (signed int)v45 < v33 )
Ritor1
parents:
diff changeset
4765 v6 += ((unsigned __int64)(30i64 * (signed int)(v45 << 16) / v33) >> 16) - 30;
Ritor1
parents:
diff changeset
4766 }
Ritor1
parents:
diff changeset
4767 }
Ritor1
parents:
diff changeset
4768 }
Ritor1
parents:
diff changeset
4769 }
Ritor1
parents:
diff changeset
4770
Ritor1
parents:
diff changeset
4771 if ( v6 <= 31 )
Ritor1
parents:
diff changeset
4772 {
Ritor1
parents:
diff changeset
4773 if ( v6 < 0 )
Ritor1
parents:
diff changeset
4774 v6 = 0;
Ritor1
parents:
diff changeset
4775 }
Ritor1
parents:
diff changeset
4776 else
Ritor1
parents:
diff changeset
4777 {
Ritor1
parents:
diff changeset
4778 v6 = 31;
Ritor1
parents:
diff changeset
4779 }
Ritor1
parents:
diff changeset
4780 return v6;
Ritor1
parents:
diff changeset
4781 }
Ritor1
parents:
diff changeset
4782
Ritor1
parents:
diff changeset
4783 //----- (00406051) --------------------------------------------------------
Ritor1
parents:
diff changeset
4784 __int16 stru262_TurnBased::StartTurn()
Ritor1
parents:
diff changeset
4785 {
Ritor1
parents:
diff changeset
4786 stru262_TurnBased *v1; // esi@1
Ritor1
parents:
diff changeset
4787 int v2; // ecx@1
Ritor1
parents:
diff changeset
4788 int v3; // ebx@1
Ritor1
parents:
diff changeset
4789 char *v4; // edi@1
Ritor1
parents:
diff changeset
4790 int v5; // eax@4
Ritor1
parents:
diff changeset
4791 int v6; // eax@12
Ritor1
parents:
diff changeset
4792 char *v7; // eax@15
Ritor1
parents:
diff changeset
4793 TurnBased_QueueElem *v8; // edi@17
Ritor1
parents:
diff changeset
4794 unsigned int v9; // edx@23
Ritor1
parents:
diff changeset
4795 char *v10; // eax@26
Ritor1
parents:
diff changeset
4796 int v11; // eax@30
Ritor1
parents:
diff changeset
4797 int v12; // ebx@30
Ritor1
parents:
diff changeset
4798 char *v13; // edi@31
Ritor1
parents:
diff changeset
4799 int v15; // [sp+Ch] [bp-10h]@5
Ritor1
parents:
diff changeset
4800 TurnBased_QueueElem *v16; // [sp+10h] [bp-Ch]@3
Ritor1
parents:
diff changeset
4801 int v17; // [sp+14h] [bp-8h]@2
Ritor1
parents:
diff changeset
4802 int v18; // [sp+14h] [bp-8h]@16
Ritor1
parents:
diff changeset
4803 signed int v19; // [sp+18h] [bp-4h]@1
Ritor1
parents:
diff changeset
4804 int v20; // [sp+18h] [bp-4h]@14
Ritor1
parents:
diff changeset
4805
Ritor1
parents:
diff changeset
4806 v1 = this;
Ritor1
parents:
diff changeset
4807 v2 = 0;
Ritor1
parents:
diff changeset
4808 v19 = 0;
Ritor1
parents:
diff changeset
4809 v3 = v1->uActorQueueSize;
Ritor1
parents:
diff changeset
4810 v1->field_1C = 0;
Ritor1
parents:
diff changeset
4811 v4 = (char *)&v1->pQueue[v3].field_4;
Ritor1
parents:
diff changeset
4812 do
Ritor1
parents:
diff changeset
4813 {
Ritor1
parents:
diff changeset
4814 v17 = v2;
Ritor1
parents:
diff changeset
4815 if ( v1->uActorQueueSize <= v2 )
Ritor1
parents:
diff changeset
4816 goto LABEL_11;
Ritor1
parents:
diff changeset
4817 v16 = v1->pQueue;
Ritor1
parents:
diff changeset
4818 while ( 1 )
Ritor1
parents:
diff changeset
4819 {
Ritor1
parents:
diff changeset
4820 v5 = v16->uPackedID;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4821 if ( PID_TYPE(v16->uPackedID) == OBJECT_Player)
0
Ritor1
parents:
diff changeset
4822 break;
Ritor1
parents:
diff changeset
4823 LABEL_8:
Ritor1
parents:
diff changeset
4824 ++v17;
Ritor1
parents:
diff changeset
4825 ++v16;
Ritor1
parents:
diff changeset
4826 if ( v17 >= v1->uActorQueueSize )
Ritor1
parents:
diff changeset
4827 goto LABEL_11;
Ritor1
parents:
diff changeset
4828 }
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4829 v15 = PID_ID(v5);
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4830 if ( !pPlayers[(PID_ID(v5)) + 1]->CanAct() || v19 != v15 )
0
Ritor1
parents:
diff changeset
4831 {
Ritor1
parents:
diff changeset
4832 v2 = 0;
Ritor1
parents:
diff changeset
4833 goto LABEL_8;
Ritor1
parents:
diff changeset
4834 }
Ritor1
parents:
diff changeset
4835 v2 = 0;
Ritor1
parents:
diff changeset
4836 LABEL_11:
Ritor1
parents:
diff changeset
4837 if ( v17 == v1->uActorQueueSize )
Ritor1
parents:
diff changeset
4838 {
Ritor1
parents:
diff changeset
4839 *(int *)v4 = 100;
Ritor1
parents:
diff changeset
4840 v6 = 8 * v19;
862
f4394e320312 * PID mistake fixed
zipi
parents: 861
diff changeset
4841 LOBYTE(v6) = PID(OBJECT_Player,v19);
0
Ritor1
parents:
diff changeset
4842 *((int *)v4 + 2) = v2;
Ritor1
parents:
diff changeset
4843 *((int *)v4 - 1) = v6;
Ritor1
parents:
diff changeset
4844 *((int *)v4 + 1) = v2;
Ritor1
parents:
diff changeset
4845 ++v3;
Ritor1
parents:
diff changeset
4846 v4 += 16;
Ritor1
parents:
diff changeset
4847 }
Ritor1
parents:
diff changeset
4848 ++v19;
Ritor1
parents:
diff changeset
4849 }
Ritor1
parents:
diff changeset
4850 while ( v19 < 4 );
Ritor1
parents:
diff changeset
4851 v1->uActorQueueSize = v3;
Ritor1
parents:
diff changeset
4852 v20 = v2;
Ritor1
parents:
diff changeset
4853 if ( ai_arrays_size > v2 )
Ritor1
parents:
diff changeset
4854 {
Ritor1
parents:
diff changeset
4855 v7 = (char *)&v1->pQueue[v3].field_4;
Ritor1
parents:
diff changeset
4856 do
Ritor1
parents:
diff changeset
4857 {
Ritor1
parents:
diff changeset
4858 v18 = v2;
Ritor1
parents:
diff changeset
4859 if ( v1->uActorQueueSize > v2 )
Ritor1
parents:
diff changeset
4860 {
Ritor1
parents:
diff changeset
4861 v8 = v1->pQueue;
Ritor1
parents:
diff changeset
4862 do
Ritor1
parents:
diff changeset
4863 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4864 if ( PID_TYPE(v8->uPackedID) == OBJECT_Actor && ai_near_actors_ids[v20] == PID_ID(v8->uPackedID) )
0
Ritor1
parents:
diff changeset
4865 break;
Ritor1
parents:
diff changeset
4866 ++v18;
Ritor1
parents:
diff changeset
4867 ++v8;
Ritor1
parents:
diff changeset
4868 }
Ritor1
parents:
diff changeset
4869 while ( v18 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
4870 v2 = 0;
Ritor1
parents:
diff changeset
4871 }
Ritor1
parents:
diff changeset
4872 if ( v18 == v1->uActorQueueSize )
Ritor1
parents:
diff changeset
4873 {
390
35a62d1948d4 More sound fixes
Nomad
parents: 389
diff changeset
4874 v9 = ai_near_actors_ids[v20];
0
Ritor1
parents:
diff changeset
4875 *(int *)v7 = 1;
Ritor1
parents:
diff changeset
4876 *((int *)v7 + 2) = v2;
862
f4394e320312 * PID mistake fixed
zipi
parents: 861
diff changeset
4877 *((int *)v7 - 1) = PID(OBJECT_Actor,v9);
0
Ritor1
parents:
diff changeset
4878 *((int *)v7 + 1) = v2;
Ritor1
parents:
diff changeset
4879 ++v3;
Ritor1
parents:
diff changeset
4880 v7 += 16;
Ritor1
parents:
diff changeset
4881 }
Ritor1
parents:
diff changeset
4882 ++v20;
Ritor1
parents:
diff changeset
4883 }
Ritor1
parents:
diff changeset
4884 while ( v20 < ai_arrays_size );
Ritor1
parents:
diff changeset
4885 }
Ritor1
parents:
diff changeset
4886 ++v1->field_0;
Ritor1
parents:
diff changeset
4887 v1->uActorQueueSize = v3;
Ritor1
parents:
diff changeset
4888 v1->field_10 = 100;
Ritor1
parents:
diff changeset
4889 if ( v3 > 0 )
Ritor1
parents:
diff changeset
4890 {
Ritor1
parents:
diff changeset
4891 v10 = (char *)&v1->pQueue[0].field_4;
Ritor1
parents:
diff changeset
4892 do
Ritor1
parents:
diff changeset
4893 {
Ritor1
parents:
diff changeset
4894 if ( *(int *)v10 <= 0 )
Ritor1
parents:
diff changeset
4895 *(int *)v10 = 100;
Ritor1
parents:
diff changeset
4896 ++v2;
Ritor1
parents:
diff changeset
4897 v10 += 16;
Ritor1
parents:
diff changeset
4898 }
Ritor1
parents:
diff changeset
4899 while ( v2 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
4900 }
Ritor1
parents:
diff changeset
4901 LOWORD(v11) = v1->_4063A1();
Ritor1
parents:
diff changeset
4902 v12 = 0;
Ritor1
parents:
diff changeset
4903 if ( v1->uActorQueueSize > 0 )
Ritor1
parents:
diff changeset
4904 {
Ritor1
parents:
diff changeset
4905 v13 = (char *)&v1->pQueue[0].field_4;
Ritor1
parents:
diff changeset
4906 do
Ritor1
parents:
diff changeset
4907 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4908 v11 = PID_TYPE(*((int *)v13 - 1));
0
Ritor1
parents:
diff changeset
4909 if ( (char)v11 == 4 )
Ritor1
parents:
diff changeset
4910 break;
Ritor1
parents:
diff changeset
4911 if ( *(int *)v13 > 0 )
Ritor1
parents:
diff changeset
4912 break;
Ritor1
parents:
diff changeset
4913 LOWORD(v11) = v1->_40680F(v12++);
Ritor1
parents:
diff changeset
4914 v13 += 16;
Ritor1
parents:
diff changeset
4915 }
Ritor1
parents:
diff changeset
4916 while ( v12 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
4917 }
Ritor1
parents:
diff changeset
4918 return v11;
Ritor1
parents:
diff changeset
4919 }
Ritor1
parents:
diff changeset
4920 // 4F75D8: using guessed type int ai_arrays_size;
Ritor1
parents:
diff changeset
4921
Ritor1
parents:
diff changeset
4922 //----- (004061CA) --------------------------------------------------------
Ritor1
parents:
diff changeset
4923 void stru262_TurnBased::NextTurn()
Ritor1
parents:
diff changeset
4924 {
Ritor1
parents:
diff changeset
4925 stru262_TurnBased *v1; // esi@1
Ritor1
parents:
diff changeset
4926 TurnBased_QueueElem *v2; // ebp@1
Ritor1
parents:
diff changeset
4927 int v3; // ebx@1
Ritor1
parents:
diff changeset
4928 int v4; // edi@7
Ritor1
parents:
diff changeset
4929 Actor *v5; // eax@9
Ritor1
parents:
diff changeset
4930 int v6; // ecx@9
Ritor1
parents:
diff changeset
4931 signed int v7; // ebx@17
Ritor1
parents:
diff changeset
4932 int v8; // ebp@27
Ritor1
parents:
diff changeset
4933 TurnBased_QueueElem *v9; // edi@28
Ritor1
parents:
diff changeset
4934 int v10; // ecx@30
Ritor1
parents:
diff changeset
4935 unsigned __int16 v11; // ax@30
Ritor1
parents:
diff changeset
4936 signed int v12; // edx@35
Ritor1
parents:
diff changeset
4937 signed int v13; // [sp+10h] [bp-4h]@7
Ritor1
parents:
diff changeset
4938
Ritor1
parents:
diff changeset
4939 v1 = this;
Ritor1
parents:
diff changeset
4940 _404544();
Ritor1
parents:
diff changeset
4941 v2 = v1->pQueue;
Ritor1
parents:
diff changeset
4942 v3 = 0;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4943 if (PID_TYPE(v1->pQueue[0].uPackedID) == OBJECT_Player)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4944 uActiveCharacter = PID_ID(v1->pQueue[0].uPackedID) + 1;
0
Ritor1
parents:
diff changeset
4945 else
Ritor1
parents:
diff changeset
4946 uActiveCharacter = 0;
Ritor1
parents:
diff changeset
4947 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
4948 if ( v1->field_1C )
Ritor1
parents:
diff changeset
4949 {
Ritor1
parents:
diff changeset
4950 pTurnEngine->field_18 |= 2u;
Ritor1
parents:
diff changeset
4951 return;
Ritor1
parents:
diff changeset
4952 }
Ritor1
parents:
diff changeset
4953 pTurnEngine->field_18 &= 0xFFFFFFFDu;
Ritor1
parents:
diff changeset
4954 if ( v1->pQueue[0].field_4 <= 0 )
Ritor1
parents:
diff changeset
4955 return;
Ritor1
parents:
diff changeset
4956 v4 = 0;
Ritor1
parents:
diff changeset
4957 v13 = 0;
Ritor1
parents:
diff changeset
4958 if ( v1->uActorQueueSize <= 0 )
Ritor1
parents:
diff changeset
4959 goto LABEL_27;
Ritor1
parents:
diff changeset
4960 do
Ritor1
parents:
diff changeset
4961 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4962 if (PID_TYPE(v2->uPackedID) != OBJECT_Player)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4963 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
4964 v5 = &pActors[PID_ID(v2->uPackedID)];
0
Ritor1
parents:
diff changeset
4965 LOWORD(v6) = v5->uAIState;
Ritor1
parents:
diff changeset
4966 if ( (short)v6 == 4
Ritor1
parents:
diff changeset
4967 || (short)v6 == 8
Ritor1
parents:
diff changeset
4968 || (short)v6 == 2
Ritor1
parents:
diff changeset
4969 || (short)v6 == 3
Ritor1
parents:
diff changeset
4970 || (short)v6 == 12
Ritor1
parents:
diff changeset
4971 || (short)v6 == 13
Ritor1
parents:
diff changeset
4972 || (short)v6 == 18
Ritor1
parents:
diff changeset
4973 || (short)v6 == 17 )
Ritor1
parents:
diff changeset
4974 {
Ritor1
parents:
diff changeset
4975 v7 = v5->uCurrentActionLength;
Ritor1
parents:
diff changeset
4976 v5->uCurrentActionTime += pEventTimer->uTimeElapsed;
Ritor1
parents:
diff changeset
4977 if ( (signed int)v5->uCurrentActionTime < v7 )
Ritor1
parents:
diff changeset
4978 {
Ritor1
parents:
diff changeset
4979 v13 = 1;
Ritor1
parents:
diff changeset
4980 LABEL_19:
Ritor1
parents:
diff changeset
4981 v3 = 0;
Ritor1
parents:
diff changeset
4982 goto LABEL_20;
Ritor1
parents:
diff changeset
4983 }
Ritor1
parents:
diff changeset
4984 v6 = (signed __int16)v6;
Ritor1
parents:
diff changeset
4985 if ( (signed __int16)v6 == 4 )
Ritor1
parents:
diff changeset
4986 {
Ritor1
parents:
diff changeset
4987 v3 = 0;
Ritor1
parents:
diff changeset
4988 v5->uAIState = Dead;
Ritor1
parents:
diff changeset
4989 v5->uCurrentActionTime = 0;
Ritor1
parents:
diff changeset
4990 v5->uCurrentActionLength = 0;
Ritor1
parents:
diff changeset
4991 v5->UpdateAnimation();
Ritor1
parents:
diff changeset
4992 }
Ritor1
parents:
diff changeset
4993 else
Ritor1
parents:
diff changeset
4994 {
Ritor1
parents:
diff changeset
4995 if ( v6 != 8 )
Ritor1
parents:
diff changeset
4996 goto LABEL_19;
Ritor1
parents:
diff changeset
4997 v3 = 0;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
4998 Actor::AI_StandOrBored(PID_ID(v2->uPackedID), ai_near_actors_targets_pid[PID_ID(v2->uPackedID)], 32, 0);
0
Ritor1
parents:
diff changeset
4999 }
Ritor1
parents:
diff changeset
5000 }
Ritor1
parents:
diff changeset
5001 }
Ritor1
parents:
diff changeset
5002 LABEL_20:
Ritor1
parents:
diff changeset
5003 ++v4;
Ritor1
parents:
diff changeset
5004 ++v2;
Ritor1
parents:
diff changeset
5005 }
Ritor1
parents:
diff changeset
5006 while ( v4 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
5007 if ( v13 != v3 )
Ritor1
parents:
diff changeset
5008 {
Ritor1
parents:
diff changeset
5009 v1->field_18 |= 1u;
Ritor1
parents:
diff changeset
5010 return;
Ritor1
parents:
diff changeset
5011 }
Ritor1
parents:
diff changeset
5012 LABEL_27:
Ritor1
parents:
diff changeset
5013 v1->field_18 &= 0xFFFFFFFEu;
Ritor1
parents:
diff changeset
5014 v8 = 0;
Ritor1
parents:
diff changeset
5015 if ( v1->uActorQueueSize > v3 )
Ritor1
parents:
diff changeset
5016 {
Ritor1
parents:
diff changeset
5017 v9 = v1->pQueue;
Ritor1
parents:
diff changeset
5018 do
Ritor1
parents:
diff changeset
5019 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5020 if (PID_TYPE(v9->uPackedID) != OBJECT_Player)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5021 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5022 v10 = PID_ID(v9->uPackedID);
0
Ritor1
parents:
diff changeset
5023 v11 = pActors[v10].uAIState;
Ritor1
parents:
diff changeset
5024 if ( v11 != 5 )
Ritor1
parents:
diff changeset
5025 {
Ritor1
parents:
diff changeset
5026 if ( v11 != 4 && v11 != 11 && v11 != 19 )
Ritor1
parents:
diff changeset
5027 {
Ritor1
parents:
diff changeset
5028 if ( v11 != 17 )
Ritor1
parents:
diff changeset
5029 {
417
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
5030 v12 = ai_near_actors_targets_pid[v10];
0
Ritor1
parents:
diff changeset
5031 v9->uActionLength = v3;
414
d8b3056df4e2 AI_Bored
Nomad
parents: 413
diff changeset
5032 Actor::AI_StandOrBored(v10, v12, 32, (AIDirection *)v3);
0
Ritor1
parents:
diff changeset
5033 }
Ritor1
parents:
diff changeset
5034 }
Ritor1
parents:
diff changeset
5035 }
Ritor1
parents:
diff changeset
5036 }
Ritor1
parents:
diff changeset
5037 ++v8;
Ritor1
parents:
diff changeset
5038 ++v9;
Ritor1
parents:
diff changeset
5039 }
Ritor1
parents:
diff changeset
5040 while ( v8 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
5041 }
Ritor1
parents:
diff changeset
5042 v1->field_4 = 3;
Ritor1
parents:
diff changeset
5043 pParty->uTimePlayed += __PAIR__(v3, 213);
Ritor1
parents:
diff changeset
5044 _494035_timed_effects__water_walking_damage__etc();
Ritor1
parents:
diff changeset
5045 v1->uActionPointsLeft = 130;
Ritor1
parents:
diff changeset
5046 }
Ritor1
parents:
diff changeset
5047
Ritor1
parents:
diff changeset
5048 //----- (004063A1) --------------------------------------------------------
Ritor1
parents:
diff changeset
5049 int stru262_TurnBased::_4063A1()
Ritor1
parents:
diff changeset
5050 {
Ritor1
parents:
diff changeset
5051 stru262_TurnBased *v1; // esi@1
Ritor1
parents:
diff changeset
5052 int v2; // ebp@1
Ritor1
parents:
diff changeset
5053 signed int result; // eax@1
Ritor1
parents:
diff changeset
5054 int v4; // edx@1
Ritor1
parents:
diff changeset
5055 int v5; // edx@3
Ritor1
parents:
diff changeset
5056 int v6; // edi@4
Ritor1
parents:
diff changeset
5057 int v7; // ecx@5
Ritor1
parents:
diff changeset
5058 Actor *v8; // ecx@11
Ritor1
parents:
diff changeset
5059 unsigned __int16 v9; // dx@12
Ritor1
parents:
diff changeset
5060 int v10; // edi@16
Ritor1
parents:
diff changeset
5061 int v11; // edx@17
Ritor1
parents:
diff changeset
5062 char v12; // zf@18
Ritor1
parents:
diff changeset
5063
Ritor1
parents:
diff changeset
5064 v1 = this;
Ritor1
parents:
diff changeset
5065 _404544();
Ritor1
parents:
diff changeset
5066 v2 = (int)&v1->pQueue[0].field_4;
Ritor1
parents:
diff changeset
5067 result = 1;
Ritor1
parents:
diff changeset
5068 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
5069 v4 = v1->pQueue[0].field_4;
Ritor1
parents:
diff changeset
5070 if ( v4 )
Ritor1
parents:
diff changeset
5071 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5072 if (PID_TYPE(v1->pQueue[0].uPackedID) == OBJECT_Player)
0
Ritor1
parents:
diff changeset
5073 {
Ritor1
parents:
diff changeset
5074 v5 = v1->uActorQueueSize;
Ritor1
parents:
diff changeset
5075 while ( 1 )
Ritor1
parents:
diff changeset
5076 {
Ritor1
parents:
diff changeset
5077 v6 = 0;
Ritor1
parents:
diff changeset
5078 if ( v5 > 0 )
Ritor1
parents:
diff changeset
5079 {
Ritor1
parents:
diff changeset
5080 v7 = (int)&v1->pQueue[0].field_4;
Ritor1
parents:
diff changeset
5081 do
Ritor1
parents:
diff changeset
5082 {
Ritor1
parents:
diff changeset
5083 --*(int *)v7;
Ritor1
parents:
diff changeset
5084 v5 = v1->uActorQueueSize;
Ritor1
parents:
diff changeset
5085 ++v6;
Ritor1
parents:
diff changeset
5086 v7 += 16;
Ritor1
parents:
diff changeset
5087 }
Ritor1
parents:
diff changeset
5088 while ( v6 < v5 );
Ritor1
parents:
diff changeset
5089 }
Ritor1
parents:
diff changeset
5090 --v1->field_10;
Ritor1
parents:
diff changeset
5091 if ( v1->field_10 <= 0 )
Ritor1
parents:
diff changeset
5092 break;
Ritor1
parents:
diff changeset
5093 if ( !*(int *)v2 )
Ritor1
parents:
diff changeset
5094 goto LABEL_9;
Ritor1
parents:
diff changeset
5095 }
Ritor1
parents:
diff changeset
5096 LABEL_24:
Ritor1
parents:
diff changeset
5097 result = 1;
Ritor1
parents:
diff changeset
5098 }
Ritor1
parents:
diff changeset
5099 else
Ritor1
parents:
diff changeset
5100 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5101 v8 = &pActors[PID_ID(v1->pQueue[0].uPackedID)];
0
Ritor1
parents:
diff changeset
5102 if ( v4 > 0 )
Ritor1
parents:
diff changeset
5103 {
Ritor1
parents:
diff changeset
5104 do
Ritor1
parents:
diff changeset
5105 {
Ritor1
parents:
diff changeset
5106 v9 = v8->uAIState;
Ritor1
parents:
diff changeset
5107 if ( v9 == 5 )
Ritor1
parents:
diff changeset
5108 break;
Ritor1
parents:
diff changeset
5109 if ( v9 == 4 || v9 == 19 || v9 == 11 )
Ritor1
parents:
diff changeset
5110 break;
Ritor1
parents:
diff changeset
5111 v10 = 0;
Ritor1
parents:
diff changeset
5112 if ( v1->uActorQueueSize > 0 )
Ritor1
parents:
diff changeset
5113 {
Ritor1
parents:
diff changeset
5114 v11 = (int)&v1->pQueue[0].field_4;
Ritor1
parents:
diff changeset
5115 do
Ritor1
parents:
diff changeset
5116 {
Ritor1
parents:
diff changeset
5117 v12 = (*(int *)v11)-- == 1;
Ritor1
parents:
diff changeset
5118 if ( v12 )
Ritor1
parents:
diff changeset
5119 *(int *)(v11 + 4) = 0;
Ritor1
parents:
diff changeset
5120 ++v10;
Ritor1
parents:
diff changeset
5121 v11 += 16;
Ritor1
parents:
diff changeset
5122 }
Ritor1
parents:
diff changeset
5123 while ( v10 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
5124 }
Ritor1
parents:
diff changeset
5125 --v1->field_10;
Ritor1
parents:
diff changeset
5126 if ( v1->field_10 <= 0 )
Ritor1
parents:
diff changeset
5127 goto LABEL_24;
Ritor1
parents:
diff changeset
5128 }
Ritor1
parents:
diff changeset
5129 while ( *(int *)v2 > 0 );
Ritor1
parents:
diff changeset
5130 }
Ritor1
parents:
diff changeset
5131 LABEL_9:
Ritor1
parents:
diff changeset
5132 result = 0;
Ritor1
parents:
diff changeset
5133 }
Ritor1
parents:
diff changeset
5134 }
Ritor1
parents:
diff changeset
5135 return result;
Ritor1
parents:
diff changeset
5136 }
Ritor1
parents:
diff changeset
5137
Ritor1
parents:
diff changeset
5138 //----- (00406457) --------------------------------------------------------
Ritor1
parents:
diff changeset
5139 int stru262_TurnBased::_406457(int a2)
Ritor1
parents:
diff changeset
5140 {
Ritor1
parents:
diff changeset
5141 stru262_TurnBased *v2; // esi@1
Ritor1
parents:
diff changeset
5142 signed int v3; // eax@1
Ritor1
parents:
diff changeset
5143 signed int v4; // ecx@2
Ritor1
parents:
diff changeset
5144 char *v5; // edx@2
Ritor1
parents:
diff changeset
5145 signed int v6; // eax@2
Ritor1
parents:
diff changeset
5146 int result; // eax@11
Ritor1
parents:
diff changeset
5147 int v8; // edx@13
Ritor1
parents:
diff changeset
5148 int v9; // ecx@14
Ritor1
parents:
diff changeset
5149 char v10; // zf@15
Ritor1
parents:
diff changeset
5150
Ritor1
parents:
diff changeset
5151 v2 = this;
Ritor1
parents:
diff changeset
5152 v3 = *(&this->field_0 + 4 * (a2 + 2));
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5153 if ( (*((char *)&this->field_0 + 16 * PID_TYPE(a2 + 2))) == OBJECT_Player)
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5154 {
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5155 v4 = PID_ID(v3);
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5156 v5 = (char *)&pParty->pTurnBasedPlayerRecoveryTimes[PID_ID(v3)];
0
Ritor1
parents:
diff changeset
5157 v6 = *(int *)v5;
Ritor1
parents:
diff changeset
5158 if ( *(int *)v5 )
Ritor1
parents:
diff changeset
5159 *(int *)v5 = 0;
Ritor1
parents:
diff changeset
5160 else
Ritor1
parents:
diff changeset
5161 v6 = pPlayers[v4 + 1]->GetAttackRecoveryTime(0);
Ritor1
parents:
diff changeset
5162 if ( v6 < 30 )
Ritor1
parents:
diff changeset
5163 v6 = 30;
Ritor1
parents:
diff changeset
5164 }
Ritor1
parents:
diff changeset
5165 else
Ritor1
parents:
diff changeset
5166 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5167 v6 = pMonsterStats->pInfos[pActors[PID_ID(v3)].pMonsterInfo.uID].uRecoveryTime;
0
Ritor1
parents:
diff changeset
5168 }
Ritor1
parents:
diff changeset
5169 v2->pQueue[a2].field_4 = v6;
Ritor1
parents:
diff changeset
5170 v2->_404544();
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5171 if (PID_TYPE(v2->pQueue[0].uPackedID) == OBJECT_Player)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5172 uActiveCharacter = PID_ID(v2->pQueue[0].uPackedID) + 1;
0
Ritor1
parents:
diff changeset
5173 else
Ritor1
parents:
diff changeset
5174 uActiveCharacter = 0;
Ritor1
parents:
diff changeset
5175 result = (int)&v2->pQueue[0].field_4;
Ritor1
parents:
diff changeset
5176 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
5177 while ( *(int *)result > 0 )
Ritor1
parents:
diff changeset
5178 {
Ritor1
parents:
diff changeset
5179 if ( v2->field_10 <= 0 )
Ritor1
parents:
diff changeset
5180 break;
Ritor1
parents:
diff changeset
5181 v8 = 0;
Ritor1
parents:
diff changeset
5182 if ( v2->uActorQueueSize > 0 )
Ritor1
parents:
diff changeset
5183 {
Ritor1
parents:
diff changeset
5184 v9 = (int)&v2->pQueue[0].field_4;
Ritor1
parents:
diff changeset
5185 do
Ritor1
parents:
diff changeset
5186 {
Ritor1
parents:
diff changeset
5187 v10 = (*(int *)v9)-- == 1;
Ritor1
parents:
diff changeset
5188 if ( v10 )
Ritor1
parents:
diff changeset
5189 *(int *)(v9 + 4) = 0;
Ritor1
parents:
diff changeset
5190 ++v8;
Ritor1
parents:
diff changeset
5191 v9 += 16;
Ritor1
parents:
diff changeset
5192 }
Ritor1
parents:
diff changeset
5193 while ( v8 < v2->uActorQueueSize );
Ritor1
parents:
diff changeset
5194 }
Ritor1
parents:
diff changeset
5195 --v2->field_10;
Ritor1
parents:
diff changeset
5196 if ( v2->field_10 <= 0 )
Ritor1
parents:
diff changeset
5197 break;
Ritor1
parents:
diff changeset
5198 }
Ritor1
parents:
diff changeset
5199 return result;
Ritor1
parents:
diff changeset
5200 }
Ritor1
parents:
diff changeset
5201
Ritor1
parents:
diff changeset
5202 //----- (0040652A) --------------------------------------------------------
Ritor1
parents:
diff changeset
5203 void stru262_TurnBased::_40652A()
Ritor1
parents:
diff changeset
5204 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5205 int *v1; // edx@2
0
Ritor1
parents:
diff changeset
5206 Actor *v2; // eax@5
Ritor1
parents:
diff changeset
5207 unsigned __int16 v3; // si@5
Ritor1
parents:
diff changeset
5208 unsigned int v4; // esi@8
Ritor1
parents:
diff changeset
5209 int v5; // [sp+Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
5210
Ritor1
parents:
diff changeset
5211 v5 = 0;
Ritor1
parents:
diff changeset
5212 if ( this->uActorQueueSize > 0 )
Ritor1
parents:
diff changeset
5213 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5214 v1 = &this->pQueue[0].field_4;
0
Ritor1
parents:
diff changeset
5215 do
Ritor1
parents:
diff changeset
5216 {
Ritor1
parents:
diff changeset
5217 if ( !*(int *)v1 )
Ritor1
parents:
diff changeset
5218 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5219 if ( PID_TYPE(*(v1 - 4)) == OBJECT_Player)
0
Ritor1
parents:
diff changeset
5220 return;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5221 v2 = &pActors[PID_ID(*(v1 - 1))];
0
Ritor1
parents:
diff changeset
5222 v3 = v2->uAIState;
141
cca78efb377e Constants -> enums
Nomad
parents: 135
diff changeset
5223 if (v3 == Standing || v3 == Fleeing || v3 == Fidgeting)
0
Ritor1
parents:
diff changeset
5224 {
Ritor1
parents:
diff changeset
5225 v4 = pMonsterStats->pInfos[v2->pMonsterInfo.uID].uRecoveryTime;
Ritor1
parents:
diff changeset
5226 *(int *)v1 = v4;
Ritor1
parents:
diff changeset
5227 if ( (signed __int64)v2->pActorBuffs[7].uExpireTime > 0 )
Ritor1
parents:
diff changeset
5228 *(int *)v1 = 2 * v4;
Ritor1
parents:
diff changeset
5229 }
Ritor1
parents:
diff changeset
5230 }
Ritor1
parents:
diff changeset
5231 ++v5;
Ritor1
parents:
diff changeset
5232 v1 += 16;
Ritor1
parents:
diff changeset
5233 }
Ritor1
parents:
diff changeset
5234 while ( v5 < this->uActorQueueSize );
Ritor1
parents:
diff changeset
5235 }
Ritor1
parents:
diff changeset
5236 }
Ritor1
parents:
diff changeset
5237
Ritor1
parents:
diff changeset
5238 //----- (004065B0) --------------------------------------------------------
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
5239 void stru262_TurnBased::_4065B0()
0
Ritor1
parents:
diff changeset
5240 {
Ritor1
parents:
diff changeset
5241 stru262_TurnBased *v1; // esi@1
Ritor1
parents:
diff changeset
5242 signed int v2; // eax@1
Ritor1
parents:
diff changeset
5243 int v3; // ebx@6
Ritor1
parents:
diff changeset
5244 int v4; // edi@7
Ritor1
parents:
diff changeset
5245 unsigned int v5; // edi@14
Ritor1
parents:
diff changeset
5246
Ritor1
parents:
diff changeset
5247 v1 = this;
Ritor1
parents:
diff changeset
5248 LOWORD(v2) = _404544();
Ritor1
parents:
diff changeset
5249 if ( v1->pQueue[0].field_4 <= 0
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5250 || ((_4063A1(), v2 = v1->pQueue[0].uPackedID, PID_TYPE(v1->pQueue[0].uPackedID) != OBJECT_Player) ? (uActiveCharacter = 0) : (v2 = (PID_ID(v2)) + 1, uActiveCharacter = v2),
0
Ritor1
parents:
diff changeset
5251 viewparams->bRedrawGameUI = 1,
Ritor1
parents:
diff changeset
5252 v1->pQueue[0].field_4 <= 0) )
Ritor1
parents:
diff changeset
5253 {
Ritor1
parents:
diff changeset
5254 v3 = 0;
Ritor1
parents:
diff changeset
5255 if ( v1->uActorQueueSize > 0 )
Ritor1
parents:
diff changeset
5256 {
Ritor1
parents:
diff changeset
5257 v4 = (int)v1->pQueue;
Ritor1
parents:
diff changeset
5258 do
Ritor1
parents:
diff changeset
5259 {
Ritor1
parents:
diff changeset
5260 v2 = *(int *)v4;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5261 if ( PID_TYPE(*(char *)v4) == OBJECT_Player || *(int *)(v4 + 4) > 0 )
0
Ritor1
parents:
diff changeset
5262 break;
Ritor1
parents:
diff changeset
5263 if ( *(int *)(v4 + 8) <= 0 )
Ritor1
parents:
diff changeset
5264 {
Ritor1
parents:
diff changeset
5265 LOWORD(v2) = v2 & 3;
Ritor1
parents:
diff changeset
5266 if ( (char)v2 == 3 )
Ritor1
parents:
diff changeset
5267 LOWORD(v2) = v1->_40680F(v3);
Ritor1
parents:
diff changeset
5268 }
Ritor1
parents:
diff changeset
5269 ++v3;
Ritor1
parents:
diff changeset
5270 v4 += 16;
Ritor1
parents:
diff changeset
5271 }
Ritor1
parents:
diff changeset
5272 while ( v3 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
5273 }
Ritor1
parents:
diff changeset
5274 }
Ritor1
parents:
diff changeset
5275 v5 = 0;
Ritor1
parents:
diff changeset
5276 if ( v1->uActorQueueSize > 0 )
Ritor1
parents:
diff changeset
5277 {
Ritor1
parents:
diff changeset
5278 do
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
5279 v1->_406648(v5++);
0
Ritor1
parents:
diff changeset
5280 while ( (signed int)v5 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
5281 }
Ritor1
parents:
diff changeset
5282 }
Ritor1
parents:
diff changeset
5283
Ritor1
parents:
diff changeset
5284 //----- (00406648) --------------------------------------------------------
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
5285 void stru262_TurnBased::_406648(unsigned int a2)
0
Ritor1
parents:
diff changeset
5286 {
Ritor1
parents:
diff changeset
5287 TurnBased_QueueElem *v1; // ecx@1
Ritor1
parents:
diff changeset
5288 int v3; // eax@1
Ritor1
parents:
diff changeset
5289 unsigned int v4; // ebx@2
Ritor1
parents:
diff changeset
5290 Actor *v5; // esi@2
Ritor1
parents:
diff changeset
5291 signed int v6; // edi@5
Ritor1
parents:
diff changeset
5292 int v7; // ecx@6
Ritor1
parents:
diff changeset
5293 int v8; // eax@6
Ritor1
parents:
diff changeset
5294 int v9; // eax@7
Ritor1
parents:
diff changeset
5295 int v10; // eax@8
Ritor1
parents:
diff changeset
5296 int v11; // eax@9
Ritor1
parents:
diff changeset
5297 int v12; // eax@10
Ritor1
parents:
diff changeset
5298 int v13; // eax@11
Ritor1
parents:
diff changeset
5299 int v14; // eax@14
Ritor1
parents:
diff changeset
5300 unsigned int v15; // ecx@14
Ritor1
parents:
diff changeset
5301 unsigned int v16; // edx@14
Ritor1
parents:
diff changeset
5302 int v17; // eax@17
Ritor1
parents:
diff changeset
5303 int v18; // eax@20
Ritor1
parents:
diff changeset
5304 char v19; // al@24
Ritor1
parents:
diff changeset
5305 unsigned int v21; // [sp-8h] [bp-50h]@16
Ritor1
parents:
diff changeset
5306 int v22; // [sp-8h] [bp-50h]@17
Ritor1
parents:
diff changeset
5307 AIDirection *v23; // [sp-4h] [bp-4Ch]@14
Ritor1
parents:
diff changeset
5308 unsigned int v24; // [sp-4h] [bp-4Ch]@17
Ritor1
parents:
diff changeset
5309 char v25; // [sp-4h] [bp-4Ch]@20
Ritor1
parents:
diff changeset
5310 AIDirection a3; // [sp+Ch] [bp-3Ch]@2
Ritor1
parents:
diff changeset
5311 AIDirection a4; // [sp+28h] [bp-20h]@2
Ritor1
parents:
diff changeset
5312 TurnBased_QueueElem *v28; // [sp+44h] [bp-4h]@1
Ritor1
parents:
diff changeset
5313 unsigned int a2a; // [sp+50h] [bp+8h]@2
Ritor1
parents:
diff changeset
5314
Ritor1
parents:
diff changeset
5315 v1 = (TurnBased_QueueElem *)((char *)this + 16 * (a2 + 2));
Ritor1
parents:
diff changeset
5316 v28 = v1;
Ritor1
parents:
diff changeset
5317 v3 = v1->uPackedID;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5318 if (PID_TYPE(v1->uPackedID) != OBJECT_Player)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5319 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5320 v4 = PID_ID(v3);
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5321 a2a = ai_near_actors_targets_pid[PID_ID(v3)];
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5322 memcpy(&a3, Actor::GetDirectionInfo(v1->uPackedID, ai_near_actors_targets_pid[PID_ID(v3)], &a3, 0), sizeof(a3));
0
Ritor1
parents:
diff changeset
5323 memcpy(&a4, &a3, sizeof(a4));
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5324 v5 = &pActors[PID_ID(v3)];
0
Ritor1
parents:
diff changeset
5325 LOWORD(v3) = v5->uAIState;
Ritor1
parents:
diff changeset
5326 if ( (short)v3 != Dead )
Ritor1
parents:
diff changeset
5327 {
Ritor1
parents:
diff changeset
5328 if ( (short)v3 != Disabled )
Ritor1
parents:
diff changeset
5329 {
Ritor1
parents:
diff changeset
5330 if ( (short)v3 != Removed )
Ritor1
parents:
diff changeset
5331 {
Ritor1
parents:
diff changeset
5332 v6 = v5->uCurrentActionLength;
Ritor1
parents:
diff changeset
5333 v5->uCurrentActionTime += pEventTimer->uTimeElapsed;
Ritor1
parents:
diff changeset
5334 if ( (signed int)v5->uCurrentActionTime >= v6 )
Ritor1
parents:
diff changeset
5335 {
Ritor1
parents:
diff changeset
5336 v7 = (signed __int16)v3;
Ritor1
parents:
diff changeset
5337 v8 = (signed __int16)v3 - 2;
Ritor1
parents:
diff changeset
5338 if ( !v8 )
Ritor1
parents:
diff changeset
5339 {
Ritor1
parents:
diff changeset
5340 v19 = stru_50C198.special_ability_use_check(&pActors[v4], v4);
Ritor1
parents:
diff changeset
5341 stru_50FE08.Add(
Ritor1
parents:
diff changeset
5342 v28->uPackedID,
Ritor1
parents:
diff changeset
5343 5120,
Ritor1
parents:
diff changeset
5344 v5->vPosition.x,
Ritor1
parents:
diff changeset
5345 v5->vPosition.y,
Ritor1
parents:
diff changeset
5346 v5->vPosition.z + ((signed int)v5->uActorHeight >> 1),
Ritor1
parents:
diff changeset
5347 v19,
Ritor1
parents:
diff changeset
5348 1);
Ritor1
parents:
diff changeset
5349 goto LABEL_25;
Ritor1
parents:
diff changeset
5350 }
Ritor1
parents:
diff changeset
5351 v9 = v8 - 1;
Ritor1
parents:
diff changeset
5352 if ( v9 )
Ritor1
parents:
diff changeset
5353 {
Ritor1
parents:
diff changeset
5354 v10 = v9 - 1;
Ritor1
parents:
diff changeset
5355 if ( !v10 )
Ritor1
parents:
diff changeset
5356 goto LABEL_21;
Ritor1
parents:
diff changeset
5357 v11 = v10 - 4;
Ritor1
parents:
diff changeset
5358 if ( !v11 )
Ritor1
parents:
diff changeset
5359 goto LABEL_25;
Ritor1
parents:
diff changeset
5360 v12 = v11 - 4;
Ritor1
parents:
diff changeset
5361 if ( v12 )
Ritor1
parents:
diff changeset
5362 {
Ritor1
parents:
diff changeset
5363 v13 = v12 - 1;
Ritor1
parents:
diff changeset
5364 if ( v13 )
Ritor1
parents:
diff changeset
5365 {
Ritor1
parents:
diff changeset
5366 if ( v13 != Dead )
Ritor1
parents:
diff changeset
5367 {
Ritor1
parents:
diff changeset
5368 if ( v7 != 4 )
Ritor1
parents:
diff changeset
5369 {
Ritor1
parents:
diff changeset
5370 v14 = rand();
Ritor1
parents:
diff changeset
5371 v15 = v4;
Ritor1
parents:
diff changeset
5372 v23 = &a4;
Ritor1
parents:
diff changeset
5373 v16 = a2a;
Ritor1
parents:
diff changeset
5374 if ( !(v14 % 2) )
Ritor1
parents:
diff changeset
5375 {
414
d8b3056df4e2 AI_Bored
Nomad
parents: 413
diff changeset
5376 Actor::AI_Bored(v4, a2a, &a4);
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
5377 return;
0
Ritor1
parents:
diff changeset
5378 }
Ritor1
parents:
diff changeset
5379 v21 = 64;
Ritor1
parents:
diff changeset
5380 LABEL_26:
413
111f25d1cc04 AI_Stand
Nomad
parents: 405
diff changeset
5381 Actor::AI_Stand(v15, v16, v21, v23);
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
5382 return;
0
Ritor1
parents:
diff changeset
5383 }
Ritor1
parents:
diff changeset
5384 LABEL_21:
Ritor1
parents:
diff changeset
5385 v5->uCurrentActionTime = 0;
Ritor1
parents:
diff changeset
5386 v5->uCurrentActionLength = 0;
Ritor1
parents:
diff changeset
5387 v5->uAIState = Dead;
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
5388 pActors[v4].UpdateAnimation();
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 321
diff changeset
5389 return;
0
Ritor1
parents:
diff changeset
5390 }
Ritor1
parents:
diff changeset
5391 v24 = v5->pMonsterInfo.uSpellSkillAndMastery2;
Ritor1
parents:
diff changeset
5392 v22 = 3;
Ritor1
parents:
diff changeset
5393 v17 = v5->pMonsterInfo.uSpell2ID;
Ritor1
parents:
diff changeset
5394 }
Ritor1
parents:
diff changeset
5395 else
Ritor1
parents:
diff changeset
5396 {
Ritor1
parents:
diff changeset
5397 v24 = v5->pMonsterInfo.uSpellSkillAndMastery1;
Ritor1
parents:
diff changeset
5398 v22 = 2;
Ritor1
parents:
diff changeset
5399 v17 = v5->pMonsterInfo.uSpell1ID;
Ritor1
parents:
diff changeset
5400 }
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5401 Actor::AI_SpellAttack(v4, &a4, v17, v22, v24);
0
Ritor1
parents:
diff changeset
5402 LABEL_25:
Ritor1
parents:
diff changeset
5403 v16 = a2a;
Ritor1
parents:
diff changeset
5404 v23 = &a4;
Ritor1
parents:
diff changeset
5405 v21 = 0;
Ritor1
parents:
diff changeset
5406 v15 = v4;
Ritor1
parents:
diff changeset
5407 goto LABEL_26;
Ritor1
parents:
diff changeset
5408 }
Ritor1
parents:
diff changeset
5409 v18 = v5->pMonsterInfo.uMissleAttack2Type;
Ritor1
parents:
diff changeset
5410 v25 = 1;
Ritor1
parents:
diff changeset
5411 }
Ritor1
parents:
diff changeset
5412 else
Ritor1
parents:
diff changeset
5413 {
Ritor1
parents:
diff changeset
5414 v18 = v5->pMonsterInfo.uMissleAttack1Type;
Ritor1
parents:
diff changeset
5415 v25 = 0;
Ritor1
parents:
diff changeset
5416 }
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5417 Actor::AI_RangedAttack(v4, &a4, v18, v25);
0
Ritor1
parents:
diff changeset
5418 goto LABEL_25;
Ritor1
parents:
diff changeset
5419 }
Ritor1
parents:
diff changeset
5420 }
Ritor1
parents:
diff changeset
5421 }
Ritor1
parents:
diff changeset
5422 }
Ritor1
parents:
diff changeset
5423 }
Ritor1
parents:
diff changeset
5424 }
Ritor1
parents:
diff changeset
5425 // 50FE08: using guessed type stru298 stru_50FE08;
Ritor1
parents:
diff changeset
5426
Ritor1
parents:
diff changeset
5427 //----- (0040680F) --------------------------------------------------------
Ritor1
parents:
diff changeset
5428 __int16 stru262_TurnBased::_40680F(int a2)
Ritor1
parents:
diff changeset
5429 {
Ritor1
parents:
diff changeset
5430 TurnBased_QueueElem *v2; // eax@1
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5431 unsigned int v3; // eax@1
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5432 unsigned int v4; // edi@2
0
Ritor1
parents:
diff changeset
5433 Actor *v5; // ebx@2
Ritor1
parents:
diff changeset
5434 unsigned int *v6; // esi@7
Ritor1
parents:
diff changeset
5435 AIDirection *v7; // esi@10
Ritor1
parents:
diff changeset
5436 int v8; // eax@10
Ritor1
parents:
diff changeset
5437 unsigned int v9; // ecx@10
Ritor1
parents:
diff changeset
5438 signed int v10; // eax@13
Ritor1
parents:
diff changeset
5439 unsigned __int8 v11; // sf@19
Ritor1
parents:
diff changeset
5440 unsigned __int8 v12; // of@19
Ritor1
parents:
diff changeset
5441 int v13; // esi@29
Ritor1
parents:
diff changeset
5442 bool v14; // eax@29
Ritor1
parents:
diff changeset
5443 unsigned __int8 v15; // cl@33
Ritor1
parents:
diff changeset
5444 AIDirection a3; // [sp+Ch] [bp-44h]@10
Ritor1
parents:
diff changeset
5445 AIDirection v18; // [sp+28h] [bp-28h]@10
Ritor1
parents:
diff changeset
5446 int a2a; // [sp+44h] [bp-Ch]@2
Ritor1
parents:
diff changeset
5447 unsigned int v20; // [sp+48h] [bp-8h]@10
Ritor1
parents:
diff changeset
5448 TurnBased_QueueElem *v21; // [sp+4Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
5449 signed int v22; // [sp+58h] [bp+8h]@10
Ritor1
parents:
diff changeset
5450
Ritor1
parents:
diff changeset
5451 v2 = (TurnBased_QueueElem *)((char *)this + 16 * (a2 + 2));
Ritor1
parents:
diff changeset
5452 v21 = v2;
Ritor1
parents:
diff changeset
5453 v2->uActionLength = 0;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5454 v3 = v2->uPackedID;
0
Ritor1
parents:
diff changeset
5455 if ( (unsigned __int8)v3 & 3 )
Ritor1
parents:
diff changeset
5456 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5457 v3 = PID_ID(v3);
0
Ritor1
parents:
diff changeset
5458 v4 = v3;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5459 a2a = v3;
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5460 v5 = &pActors[v3];
0
Ritor1
parents:
diff changeset
5461 LOWORD(v3) = v5->uAIState;
Ritor1
parents:
diff changeset
5462 if ( (short)v3 != 5 )
Ritor1
parents:
diff changeset
5463 {
Ritor1
parents:
diff changeset
5464 if ( (short)v3 != 4 && (short)v3 != 11 && (short)v3 != 19 && (short)v3 != 17 )
Ritor1
parents:
diff changeset
5465 {
417
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
5466 v6 = (unsigned int *)&ai_near_actors_targets_pid[(int)v4];
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
5467 Actor::_SelectTarget((unsigned int)v4, &ai_near_actors_targets_pid[(int)v4], true);
0
Ritor1
parents:
diff changeset
5468 if ( v5->pMonsterInfo.uHostilityType && !*v6 )
Ritor1
parents:
diff changeset
5469 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
Ritor1
parents:
diff changeset
5470 v22 = *v6;
862
f4394e320312 * PID mistake fixed
zipi
parents: 861
diff changeset
5471 v7 = Actor::GetDirectionInfo(PID(OBJECT_Actor,(int)v4), *v6, &a3, 0);
0
Ritor1
parents:
diff changeset
5472 v8 = v5->uActorRadius;
Ritor1
parents:
diff changeset
5473 memcpy(&a3, v7, sizeof(a3));
Ritor1
parents:
diff changeset
5474 memcpy(&v18, &a3, sizeof(v18));
Ritor1
parents:
diff changeset
5475 v9 = a3.uDistance - v8;
Ritor1
parents:
diff changeset
5476 v20 = a3.uDistance - v8;
Ritor1
parents:
diff changeset
5477 if ( ((a3.uDistance - v8) & 0x80000000u) != 0 )
Ritor1
parents:
diff changeset
5478 {
Ritor1
parents:
diff changeset
5479 v9 = 0;
Ritor1
parents:
diff changeset
5480 v20 = 0;
Ritor1
parents:
diff changeset
5481 }
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5482 if (PID_TYPE(v22) == OBJECT_Actor)
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1254
diff changeset
5483 //v10 = (unsigned __int8)*(&byte_5C8D1A[89 * (pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID - 1) / 3] + (v5->pMonsterInfo.uID - 1) / 3);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1254
diff changeset
5484 v10 = pFactionTable->relations[(pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID) / 3 + 1][(v5->pMonsterInfo.uID - 1) / 3 + 1];
0
Ritor1
parents:
diff changeset
5485 else
Ritor1
parents:
diff changeset
5486 v10 = 4;
Ritor1
parents:
diff changeset
5487 if ( v10 == 1 )
Ritor1
parents:
diff changeset
5488 {
Ritor1
parents:
diff changeset
5489 if ( (double)(signed int)v20 < 307.2 )
Ritor1
parents:
diff changeset
5490 goto LABEL_25;
Ritor1
parents:
diff changeset
5491 }
Ritor1
parents:
diff changeset
5492 else
Ritor1
parents:
diff changeset
5493 {
Ritor1
parents:
diff changeset
5494 if ( v10 == 2 )
Ritor1
parents:
diff changeset
5495 {
Ritor1
parents:
diff changeset
5496 v12 = __OFSUB__(v9, 1024);
Ritor1
parents:
diff changeset
5497 v11 = ((v9 - 1024) & 0x80000000u) != 0;
Ritor1
parents:
diff changeset
5498 }
Ritor1
parents:
diff changeset
5499 else
Ritor1
parents:
diff changeset
5500 {
Ritor1
parents:
diff changeset
5501 if ( v10 == 3 )
Ritor1
parents:
diff changeset
5502 {
Ritor1
parents:
diff changeset
5503 v12 = __OFSUB__(v9, 2560);
Ritor1
parents:
diff changeset
5504 v11 = ((v9 - 2560) & 0x80000000u) != 0;
Ritor1
parents:
diff changeset
5505 }
Ritor1
parents:
diff changeset
5506 else
Ritor1
parents:
diff changeset
5507 {
Ritor1
parents:
diff changeset
5508 if ( v10 != 4 )
Ritor1
parents:
diff changeset
5509 goto LABEL_26;
Ritor1
parents:
diff changeset
5510 v12 = __OFSUB__(v9, 5120);
Ritor1
parents:
diff changeset
5511 v11 = ((v9 - 5120) & 0x80000000u) != 0;
Ritor1
parents:
diff changeset
5512 }
Ritor1
parents:
diff changeset
5513 }
Ritor1
parents:
diff changeset
5514 if ( v11 ^ v12 )
Ritor1
parents:
diff changeset
5515 {
Ritor1
parents:
diff changeset
5516 LABEL_25:
Ritor1
parents:
diff changeset
5517 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
Ritor1
parents:
diff changeset
5518 goto LABEL_26;
Ritor1
parents:
diff changeset
5519 }
Ritor1
parents:
diff changeset
5520 }
Ritor1
parents:
diff changeset
5521 LABEL_26:
Ritor1
parents:
diff changeset
5522 if ( v5->pMonsterInfo.uHostilityType != 4 || !v22 || (signed int)v9 >= 5120 )
Ritor1
parents:
diff changeset
5523 {
Ritor1
parents:
diff changeset
5524 v13 = a2a;
Ritor1
parents:
diff changeset
5525 goto LABEL_47;
Ritor1
parents:
diff changeset
5526 }
Ritor1
parents:
diff changeset
5527 v13 = a2a;
Ritor1
parents:
diff changeset
5528 v14 = stru_50C198.special_ability_use_check(v5, a2a);
Ritor1
parents:
diff changeset
5529 if ( v14 == 1 )
Ritor1
parents:
diff changeset
5530 {
Ritor1
parents:
diff changeset
5531 if ( v5->pMonsterInfo.uMissleAttack2Type )
Ritor1
parents:
diff changeset
5532 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5533 Actor::AI_MissileAttack2(v13, v22, &v18);
0
Ritor1
parents:
diff changeset
5534 goto LABEL_43;
Ritor1
parents:
diff changeset
5535 }
Ritor1
parents:
diff changeset
5536 }
Ritor1
parents:
diff changeset
5537 else
Ritor1
parents:
diff changeset
5538 {
Ritor1
parents:
diff changeset
5539 if ( v14 > 1 && v14 <= 3 )
Ritor1
parents:
diff changeset
5540 {
Ritor1
parents:
diff changeset
5541 if ( v14 == 2 )
Ritor1
parents:
diff changeset
5542 v15 = v5->pMonsterInfo.uSpell1ID;
Ritor1
parents:
diff changeset
5543 else
Ritor1
parents:
diff changeset
5544 v15 = v5->pMonsterInfo.uSpell2ID;
Ritor1
parents:
diff changeset
5545 if ( v15 )
Ritor1
parents:
diff changeset
5546 {
Ritor1
parents:
diff changeset
5547 if ( v14 == 2 )
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5548 Actor::AI_SpellAttack1(v13, v22, &v18);
0
Ritor1
parents:
diff changeset
5549 else
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5550 Actor::AI_SpellAttack2(v13, v22, &v18);
0
Ritor1
parents:
diff changeset
5551 goto LABEL_43;
Ritor1
parents:
diff changeset
5552 }
Ritor1
parents:
diff changeset
5553 goto LABEL_44;
Ritor1
parents:
diff changeset
5554 }
Ritor1
parents:
diff changeset
5555 if ( v5->pMonsterInfo.uMissleAttack1Type )
Ritor1
parents:
diff changeset
5556 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5557 Actor::AI_MissileAttack1(v13, v22, &v18);
0
Ritor1
parents:
diff changeset
5558 LABEL_43:
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5559 //v3 = v21;
0
Ritor1
parents:
diff changeset
5560 v21->field_C = 1;
Ritor1
parents:
diff changeset
5561 LABEL_48:
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5562 v21->uActionLength = v5->uCurrentActionLength;
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5563 //return (signed __int16)v3;
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5564 return (signed __int16)&v21;
0
Ritor1
parents:
diff changeset
5565 }
Ritor1
parents:
diff changeset
5566 }
Ritor1
parents:
diff changeset
5567 LABEL_44:
Ritor1
parents:
diff changeset
5568 if ( (double)(signed int)v20 < 307.2 )
Ritor1
parents:
diff changeset
5569 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5570 Actor::AI_MeleeAttack(v13, v22, &v18);
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5571 //v3 = v21;
0
Ritor1
parents:
diff changeset
5572 v21->field_C = 3;
Ritor1
parents:
diff changeset
5573 goto LABEL_48;
Ritor1
parents:
diff changeset
5574 }
Ritor1
parents:
diff changeset
5575 LABEL_47:
413
111f25d1cc04 AI_Stand
Nomad
parents: 405
diff changeset
5576 Actor::AI_Stand(v13, v22, 0x40u, &v18);
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5577 //v3 = v21;
0
Ritor1
parents:
diff changeset
5578 v21->field_C = 0;
Ritor1
parents:
diff changeset
5579 goto LABEL_48;
Ritor1
parents:
diff changeset
5580 }
Ritor1
parents:
diff changeset
5581 }
Ritor1
parents:
diff changeset
5582 }
Ritor1
parents:
diff changeset
5583 return (signed __int16)v3;
Ritor1
parents:
diff changeset
5584 }
Ritor1
parents:
diff changeset
5585
Ritor1
parents:
diff changeset
5586 //----- (00406A63) --------------------------------------------------------
Ritor1
parents:
diff changeset
5587 void stru262_TurnBased::_406A63()
Ritor1
parents:
diff changeset
5588 {
Ritor1
parents:
diff changeset
5589 stru262_TurnBased *v1; // ebx@1
Ritor1
parents:
diff changeset
5590 int v2; // esi@1
Ritor1
parents:
diff changeset
5591 unsigned __int8 v3; // zf@1
Ritor1
parents:
diff changeset
5592 unsigned __int8 v4; // sf@1
Ritor1
parents:
diff changeset
5593 signed int v5; // ecx@4
Ritor1
parents:
diff changeset
5594 AIDirection a3; // [sp+8h] [bp-44h]@5
Ritor1
parents:
diff changeset
5595 AIDirection v7; // [sp+24h] [bp-28h]@5
Ritor1
parents:
diff changeset
5596 unsigned int v8; // [sp+40h] [bp-Ch]@5
Ritor1
parents:
diff changeset
5597 signed int a2; // [sp+44h] [bp-8h]@1
Ritor1
parents:
diff changeset
5598 TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2
Ritor1
parents:
diff changeset
5599
Ritor1
parents:
diff changeset
5600 v1 = this;
Ritor1
parents:
diff changeset
5601 v2 = 0;
Ritor1
parents:
diff changeset
5602 this->field_8 = 64;
Ritor1
parents:
diff changeset
5603 dword_50C994 = 0;
Ritor1
parents:
diff changeset
5604 uActiveCharacter = 0;
Ritor1
parents:
diff changeset
5605 v3 = this->uActorQueueSize == 0;
Ritor1
parents:
diff changeset
5606 v4 = this->uActorQueueSize < 0;
Ritor1
parents:
diff changeset
5607 a2 = 0;
Ritor1
parents:
diff changeset
5608 if ( !(v4 | v3) )
Ritor1
parents:
diff changeset
5609 {
Ritor1
parents:
diff changeset
5610 v10 = this->pQueue;
Ritor1
parents:
diff changeset
5611 while ( 1 )
Ritor1
parents:
diff changeset
5612 {
Ritor1
parents:
diff changeset
5613 v5 = v10->uPackedID;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5614 if (PID_TYPE(v10->uPackedID) == OBJECT_Actor)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5615 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5616 v8 = ai_near_actors_targets_pid[PID_ID(v5)];
0
Ritor1
parents:
diff changeset
5617 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7));
Ritor1
parents:
diff changeset
5618 if ( !v1->_406D10(a2) )
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5619 Actor::AI_Stand(PID_ID(v10->uPackedID), v8, 0x20u, &v7);
0
Ritor1
parents:
diff changeset
5620 }
Ritor1
parents:
diff changeset
5621 ++a2;
Ritor1
parents:
diff changeset
5622 ++v10;
Ritor1
parents:
diff changeset
5623 if ( a2 >= v1->uActorQueueSize )
Ritor1
parents:
diff changeset
5624 break;
Ritor1
parents:
diff changeset
5625 v2 = 0;
Ritor1
parents:
diff changeset
5626 }
Ritor1
parents:
diff changeset
5627 }
Ritor1
parents:
diff changeset
5628 }
Ritor1
parents:
diff changeset
5629 // 50C994: using guessed type int dword_50C994;
Ritor1
parents:
diff changeset
5630
Ritor1
parents:
diff changeset
5631 //----- (00406AFE) --------------------------------------------------------
Ritor1
parents:
diff changeset
5632 void stru262_TurnBased::_406AFE()
Ritor1
parents:
diff changeset
5633 {
Ritor1
parents:
diff changeset
5634 stru262_TurnBased *v1; // edi@1
Ritor1
parents:
diff changeset
5635 TurnBased_QueueElem *v2; // ebx@2
Ritor1
parents:
diff changeset
5636 int v3; // esi@4
Ritor1
parents:
diff changeset
5637 int v4; // ecx@5
Ritor1
parents:
diff changeset
5638 AIDirection a3; // [sp+4h] [bp-48h]@5
Ritor1
parents:
diff changeset
5639 AIDirection v6; // [sp+20h] [bp-2Ch]@5
Ritor1
parents:
diff changeset
5640 stru262_TurnBased *v7; // [sp+3Ch] [bp-10h]@1
Ritor1
parents:
diff changeset
5641 unsigned int v8; // [sp+40h] [bp-Ch]@4
Ritor1
parents:
diff changeset
5642 unsigned int v9; // [sp+44h] [bp-8h]@5
Ritor1
parents:
diff changeset
5643 int v10; // [sp+48h] [bp-4h]@1
Ritor1
parents:
diff changeset
5644
Ritor1
parents:
diff changeset
5645 v10 = 0;
Ritor1
parents:
diff changeset
5646 v1 = this;
Ritor1
parents:
diff changeset
5647 v7 = this;
Ritor1
parents:
diff changeset
5648 if ( this->uActorQueueSize > 0 )
Ritor1
parents:
diff changeset
5649 {
Ritor1
parents:
diff changeset
5650 v2 = this->pQueue;
Ritor1
parents:
diff changeset
5651 do
Ritor1
parents:
diff changeset
5652 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5653 if (PID_TYPE(v2->uPackedID) == OBJECT_Actor)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5654 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5655 v3 = PID_ID(v2->uPackedID);
0
Ritor1
parents:
diff changeset
5656 v8 = v3;
Ritor1
parents:
diff changeset
5657 if ( pActors[v3].CanAct() )
Ritor1
parents:
diff changeset
5658 {
Ritor1
parents:
diff changeset
5659 v4 = v2->uPackedID;
417
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
5660 v9 = ai_near_actors_targets_pid[v3];
0
Ritor1
parents:
diff changeset
5661 memcpy(&v6, Actor::GetDirectionInfo(v4, v9, &a3, 0), sizeof(v6));
413
111f25d1cc04 AI_Stand
Nomad
parents: 405
diff changeset
5662 Actor::AI_Stand(v8, v9, 0x20u, &v6);
0
Ritor1
parents:
diff changeset
5663 v2->field_C = 0;
Ritor1
parents:
diff changeset
5664 v2->uActionLength = 0;
Ritor1
parents:
diff changeset
5665 v1 = v7;
Ritor1
parents:
diff changeset
5666 }
Ritor1
parents:
diff changeset
5667 }
Ritor1
parents:
diff changeset
5668 ++v10;
Ritor1
parents:
diff changeset
5669 ++v2;
Ritor1
parents:
diff changeset
5670 }
Ritor1
parents:
diff changeset
5671 while ( v10 < v1->uActorQueueSize );
Ritor1
parents:
diff changeset
5672 }
Ritor1
parents:
diff changeset
5673 v1->field_4 = 2;
Ritor1
parents:
diff changeset
5674 v1->field_8 = 100;
Ritor1
parents:
diff changeset
5675 }
Ritor1
parents:
diff changeset
5676
Ritor1
parents:
diff changeset
5677 //----- (00406B9F) --------------------------------------------------------
Ritor1
parents:
diff changeset
5678 int stru262_TurnBased::_406B9F()
Ritor1
parents:
diff changeset
5679 {
Ritor1
parents:
diff changeset
5680 signed int result; // eax@1
Ritor1
parents:
diff changeset
5681 unsigned __int8 v2; // zf@1
Ritor1
parents:
diff changeset
5682 unsigned __int8 v3; // sf@1
Ritor1
parents:
diff changeset
5683 int v4; // esi@4
Ritor1
parents:
diff changeset
5684 unsigned int v5; // esi@5
Ritor1
parents:
diff changeset
5685 Actor *v6; // ebx@5
Ritor1
parents:
diff changeset
5686 unsigned __int16 v7; // cx@15
Ritor1
parents:
diff changeset
5687 AIDirection a3; // [sp+0h] [bp-50h]@15
Ritor1
parents:
diff changeset
5688 AIDirection v9; // [sp+1Ch] [bp-34h]@15
Ritor1
parents:
diff changeset
5689 signed int a1; // [sp+38h] [bp-18h]@4
Ritor1
parents:
diff changeset
5690 stru262_TurnBased *thisa; // [sp+3Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
5691 unsigned int v12; // [sp+40h] [bp-10h]@5
Ritor1
parents:
diff changeset
5692 unsigned int v13; // [sp+44h] [bp-Ch]@8
Ritor1
parents:
diff changeset
5693 TurnBased_QueueElem *v14; // [sp+48h] [bp-8h]@2
Ritor1
parents:
diff changeset
5694 signed int a2; // [sp+4Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
5695
Ritor1
parents:
diff changeset
5696 result = 0;
Ritor1
parents:
diff changeset
5697 thisa = this;
Ritor1
parents:
diff changeset
5698 v2 = this->uActorQueueSize == 0;
Ritor1
parents:
diff changeset
5699 v3 = this->uActorQueueSize < 0;
Ritor1
parents:
diff changeset
5700 a2 = 0;
Ritor1
parents:
diff changeset
5701 if ( !(v3 | v2) )
Ritor1
parents:
diff changeset
5702 {
Ritor1
parents:
diff changeset
5703 v14 = this->pQueue;
Ritor1
parents:
diff changeset
5704 while ( 1 )
Ritor1
parents:
diff changeset
5705 {
Ritor1
parents:
diff changeset
5706 v4 = v14->uPackedID;
Ritor1
parents:
diff changeset
5707 a1 = v14->uPackedID;
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5708 if (PID_TYPE(a1) != OBJECT_Player)
0
Ritor1
parents:
diff changeset
5709 {
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
5710 v5 = PID_ID(v4);
0
Ritor1
parents:
diff changeset
5711 v12 = v5;
Ritor1
parents:
diff changeset
5712 v6 = &pActors[v5];
Ritor1
parents:
diff changeset
5713 if ( SHIDWORD(v6->pActorBuffs[5].uExpireTime) < result
Ritor1
parents:
diff changeset
5714 || SHIDWORD(v6->pActorBuffs[5].uExpireTime) <= result && LODWORD(v6->pActorBuffs[5].uExpireTime) <= result )
Ritor1
parents:
diff changeset
5715 v13 = result;
Ritor1
parents:
diff changeset
5716 else
Ritor1
parents:
diff changeset
5717 v13 = 1;
Ritor1
parents:
diff changeset
5718 if ( SHIDWORD(v6->pActorBuffs[6].uExpireTime) >= result
Ritor1
parents:
diff changeset
5719 && (SHIDWORD(v6->pActorBuffs[6].uExpireTime) > result || LODWORD(v6->pActorBuffs[6].uExpireTime) > result) )
Ritor1
parents:
diff changeset
5720 result = 1;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1108
diff changeset
5721 if ( !(v13 != 0 || result || v6->uAIState == 5 || v6->uAIState == 11 || v6->uAIState == 19) )
0
Ritor1
parents:
diff changeset
5722 {
417
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
5723 v13 = ai_near_actors_targets_pid[v5];
0
Ritor1
parents:
diff changeset
5724 memcpy(&v9, Actor::GetDirectionInfo(a1, v13, &a3, 0), sizeof(v9));
Ritor1
parents:
diff changeset
5725 v7 = v6->uAIState;
Ritor1
parents:
diff changeset
5726 if ( v7 == 6 || v7 == 1 )
Ritor1
parents:
diff changeset
5727 {
Ritor1
parents:
diff changeset
5728 if ( (double)(signed int)v9.uDistance < 307.2 )
Ritor1
parents:
diff changeset
5729 goto LABEL_26;
Ritor1
parents:
diff changeset
5730 }
Ritor1
parents:
diff changeset
5731 v6->uCurrentActionTime += pEventTimer->uTimeElapsed;
Ritor1
parents:
diff changeset
5732 if ( (signed int)v6->uCurrentActionTime > v6->uCurrentActionLength )
Ritor1
parents:
diff changeset
5733 {
Ritor1
parents:
diff changeset
5734 if ( v7 == 4 )
Ritor1
parents:
diff changeset
5735 {
Ritor1
parents:
diff changeset
5736 v6->uCurrentActionTime = 0;
Ritor1
parents:
diff changeset
5737 v6->uCurrentActionLength = 0;
Ritor1
parents:
diff changeset
5738 v6->uAIState = Dead;
Ritor1
parents:
diff changeset
5739 v6->UpdateAnimation();
Ritor1
parents:
diff changeset
5740 }
Ritor1
parents:
diff changeset
5741 if ( !thisa->_406D10(a2) )
Ritor1
parents:
diff changeset
5742 LABEL_26:
413
111f25d1cc04 AI_Stand
Nomad
parents: 405
diff changeset
5743 Actor::AI_Stand(v12, v13, 0x20u, &v9);
0
Ritor1
parents:
diff changeset
5744 }
Ritor1
parents:
diff changeset
5745 }
Ritor1
parents:
diff changeset
5746 }
Ritor1
parents:
diff changeset
5747 ++a2;
Ritor1
parents:
diff changeset
5748 result = (signed int)thisa;
Ritor1
parents:
diff changeset
5749 ++v14;
Ritor1
parents:
diff changeset
5750 if ( a2 >= thisa->uActorQueueSize )
Ritor1
parents:
diff changeset
5751 break;
Ritor1
parents:
diff changeset
5752 result = 0;
Ritor1
parents:
diff changeset
5753 }
Ritor1
parents:
diff changeset
5754 }
Ritor1
parents:
diff changeset
5755 return result;
Ritor1
parents:
diff changeset
5756 }
Ritor1
parents:
diff changeset
5757
Ritor1
parents:
diff changeset
5758 //----- (00406D10) --------------------------------------------------------
Ritor1
parents:
diff changeset
5759 bool stru262_TurnBased::_406D10(signed int a2)
Ritor1
parents:
diff changeset
5760 {
Ritor1
parents:
diff changeset
5761 int v2; // ecx@1
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5762 //int v3; // ecx@2
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5763 Actor *actor; // ebx@2
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5764 //unsigned __int16 v5; // dx@2
0
Ritor1
parents:
diff changeset
5765 int *v6; // esi@7
Ritor1
parents:
diff changeset
5766 TurnBased_QueueElem *v7; // edi@7
Ritor1
parents:
diff changeset
5767 int v8; // eax@7
Ritor1
parents:
diff changeset
5768 AIDirection *v9; // esi@10
Ritor1
parents:
diff changeset
5769 int v10; // eax@10
Ritor1
parents:
diff changeset
5770 unsigned int v11; // ecx@10
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5771 unsigned __int8 pHostileType; // al@12
0
Ritor1
parents:
diff changeset
5772 unsigned __int8 v13; // sf@16
Ritor1
parents:
diff changeset
5773 unsigned __int8 v14; // of@16
Ritor1
parents:
diff changeset
5774 unsigned int v15; // edx@22
Ritor1
parents:
diff changeset
5775 unsigned int v16; // ecx@23
Ritor1
parents:
diff changeset
5776 TurnBased_QueueElem *v17; // eax@25
Ritor1
parents:
diff changeset
5777 double v18; // st7@33
Ritor1
parents:
diff changeset
5778 double v19; // st6@33
Ritor1
parents:
diff changeset
5779 int v21; // [sp-8h] [bp-5Ch]@23
Ritor1
parents:
diff changeset
5780 int v22; // [sp-8h] [bp-5Ch]@26
Ritor1
parents:
diff changeset
5781 AIDirection *v23; // [sp-4h] [bp-58h]@23
Ritor1
parents:
diff changeset
5782 int v24; // [sp-4h] [bp-58h]@26
Ritor1
parents:
diff changeset
5783 AIDirection a3; // [sp+Ch] [bp-48h]@10
Ritor1
parents:
diff changeset
5784 AIDirection pDir; // [sp+28h] [bp-2Ch]@10
Ritor1
parents:
diff changeset
5785 int v27; // [sp+44h] [bp-10h]@33
Ritor1
parents:
diff changeset
5786 unsigned int v28; // [sp+48h] [bp-Ch]@10
Ritor1
parents:
diff changeset
5787 TurnBased_QueueElem *v29; // [sp+4Ch] [bp-8h]@7
Ritor1
parents:
diff changeset
5788 unsigned int uActorID; // [sp+50h] [bp-4h]@2
Ritor1
parents:
diff changeset
5789 unsigned int a2a; // [sp+5Ch] [bp+8h]@7
Ritor1
parents:
diff changeset
5790
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5791 __debugbreak();//ñðàáàòûâàåò ïðè ïîøàãîâîì ðåæèìå ïîñëå ïÿòè øàãîâ
0
Ritor1
parents:
diff changeset
5792 v2 = *(&this->field_0 + 4 * (a2 + 2));
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
5793 if (PID_TYPE(v2) == OBJECT_Player)
0
Ritor1
parents:
diff changeset
5794 return 0;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5795 uActorID = PID_ID(v2);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5796 //uActorID = v3;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5797 actor = &pActors[uActorID];
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5798 //v5 = v4->uAIState;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5799 if ( actor->uAIState == 5 || actor->uAIState == 4 || actor->uAIState == 11 || actor->uAIState == 19 || actor->uAIState == 17 )
0
Ritor1
parents:
diff changeset
5800 return 1;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5801 v6 = &ai_near_actors_targets_pid[uActorID];
0
Ritor1
parents:
diff changeset
5802 v7 = &pTurnEngine->pQueue[a2];
Ritor1
parents:
diff changeset
5803 v8 = *v6;
Ritor1
parents:
diff changeset
5804 v29 = &pTurnEngine->pQueue[a2];
Ritor1
parents:
diff changeset
5805 a2a = v8;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5806 Actor::_SelectTarget(uActorID, &ai_near_actors_targets_pid[uActorID], true);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5807 if ( actor->pMonsterInfo.uHostilityType && !*v6 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5808 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
0
Ritor1
parents:
diff changeset
5809 v9 = Actor::GetDirectionInfo(v7->uPackedID, a2a, &a3, 0);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5810 v10 = actor->uActorRadius;
0
Ritor1
parents:
diff changeset
5811 memcpy(&a3, v9, sizeof(a3));
Ritor1
parents:
diff changeset
5812 memcpy(&pDir, &a3, sizeof(pDir));
Ritor1
parents:
diff changeset
5813 v11 = a3.uDistance - v10;
Ritor1
parents:
diff changeset
5814 v28 = a3.uDistance - v10;
Ritor1
parents:
diff changeset
5815 if ( ((a3.uDistance - v10) & 0x80000000u) != 0 )
Ritor1
parents:
diff changeset
5816 {
Ritor1
parents:
diff changeset
5817 v11 = 0;
Ritor1
parents:
diff changeset
5818 v28 = 0;
Ritor1
parents:
diff changeset
5819 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5820 pHostileType = actor->pMonsterInfo.uHostilityType;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5821 if ( pHostileType == 1 )
0
Ritor1
parents:
diff changeset
5822 {
Ritor1
parents:
diff changeset
5823 if ( (double)(signed int)v28 >= 307.2 )
Ritor1
parents:
diff changeset
5824 goto LABEL_21;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5825 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
0
Ritor1
parents:
diff changeset
5826 goto LABEL_21;
Ritor1
parents:
diff changeset
5827 }
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5828 if ( pHostileType == 2 )
0
Ritor1
parents:
diff changeset
5829 {
Ritor1
parents:
diff changeset
5830 v14 = __OFSUB__(v11, 1024);
Ritor1
parents:
diff changeset
5831 v13 = ((v11 - 1024) & 0x80000000u) != 0;
Ritor1
parents:
diff changeset
5832 }
Ritor1
parents:
diff changeset
5833 else
Ritor1
parents:
diff changeset
5834 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5835 if ( pHostileType != 3 )
0
Ritor1
parents:
diff changeset
5836 goto LABEL_21;
Ritor1
parents:
diff changeset
5837 v14 = __OFSUB__(v11, 2560);
Ritor1
parents:
diff changeset
5838 v13 = ((v11 - 2560) & 0x80000000u) != 0;
Ritor1
parents:
diff changeset
5839 }
Ritor1
parents:
diff changeset
5840 if ( v13 ^ v14 )
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5841 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5842 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5843 }
0
Ritor1
parents:
diff changeset
5844 LABEL_21:
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5845 if ( (signed __int64)actor->pActorBuffs[4].uExpireTime > 0 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5846 {
0
Ritor1
parents:
diff changeset
5847 if ( (signed int)v11 < 10240 )
Ritor1
parents:
diff changeset
5848 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5849 Actor::AI_Flee(uActorID, a2a, 0, &pDir);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5850 v29->field_C = 4;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5851 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5852 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5853 }
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5854 Actor::AI_4032B2(uActorID, a2a, 1024, 0);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5855 v29->field_C = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5856 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5857 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5858 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5859 if ( actor->pMonsterInfo.uHostilityType != 4 )
0
Ritor1
parents:
diff changeset
5860 goto LABEL_46;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5861 if ( !(actor->uAttributes & 0x020000) || actor->pMonsterInfo.uAIType == 1 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5862 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5863 if ( actor->pMonsterInfo.uAIType == 1 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5864 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5865 if ( actor->pMonsterInfo.uMovementType == 5 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5866 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5867 Actor::AI_Stand(uActorID, a2a, 32, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5868 v29->field_C = 4;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5869 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5870 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5871 }
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5872 Actor::AI_Flee(uActorID, a2a, 32, 0);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5873 v29->field_C = 4;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5874 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5875 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5876 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5877 if ( actor->pMonsterInfo.uAIType == 2 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5878 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5879 v27 = actor->sCurrentHP;
0
Ritor1
parents:
diff changeset
5880 v18 = (double)v27;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5881 v19 = (double)(signed int)actor->pMonsterInfo.uHP * 0.2;
0
Ritor1
parents:
diff changeset
5882 if ( v19 > v18 && (signed int)v11 < 10240 )
Ritor1
parents:
diff changeset
5883 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5884 if ( actor->pMonsterInfo.uMovementType == 5 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5885 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5886 Actor::AI_Stand(uActorID, a2a, 32, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5887 v29->field_C = 4;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5888 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5889 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5890 }
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5891 Actor::AI_Flee(uActorID, a2a, 32, 0);
0
Ritor1
parents:
diff changeset
5892 v29->field_C = 4;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5893 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5894 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5895 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5896 goto LABEL_39;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5897 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5898 if ( actor->pMonsterInfo.uAIType == 3 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5899 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5900 v27 = actor->sCurrentHP;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5901 v18 = (double)v27;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5902 v19 = (double)(signed int)actor->pMonsterInfo.uHP * 0.1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5903 if ( v19 > v18 && (signed int)v11 < 10240 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5904 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5905 if ( actor->pMonsterInfo.uMovementType == 5 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5906 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5907 Actor::AI_Stand(uActorID, a2a, 32, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5908 v29->field_C = 4;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5909 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5910 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5911 }
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5912 Actor::AI_Flee(uActorID, a2a, 32, 0);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5913 v29->field_C = 4;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5914 v29->uActionLength = actor->uCurrentActionLength;
0
Ritor1
parents:
diff changeset
5915 return 1;
Ritor1
parents:
diff changeset
5916 }
Ritor1
parents:
diff changeset
5917 goto LABEL_39;
Ritor1
parents:
diff changeset
5918 }
Ritor1
parents:
diff changeset
5919 }
Ritor1
parents:
diff changeset
5920 LABEL_39:
Ritor1
parents:
diff changeset
5921 if ( (double)(signed int)v28 < 307.2 )
Ritor1
parents:
diff changeset
5922 return 0;
Ritor1
parents:
diff changeset
5923 if ( (signed int)v11 < 5120 )
Ritor1
parents:
diff changeset
5924 {
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5925 if ( actor->pMonsterInfo.uMissleAttack1Type && (signed int)v11 < 1024 )
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5926 Actor::AI_Pursue1(uActorID, a2a, uActorID, 32, &pDir);
0
Ritor1
parents:
diff changeset
5927 else
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5928 Actor::AI_Pursue2(uActorID, a2a, 32, &pDir, 307);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5929 v29->field_C = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5930 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5931 return 1;
0
Ritor1
parents:
diff changeset
5932 }
Ritor1
parents:
diff changeset
5933 LABEL_46:
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5934 if ( !actor->pMonsterInfo.uMovementType )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5935 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5936 Actor::AI_4032B2(uActorID, a2a, 1024, 32);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5937 v29->field_C = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5938 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5939 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5940 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5941 if ( actor->pMonsterInfo.uMovementType == 1 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5942 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5943 Actor::AI_4032B2(uActorID, a2a, 2560, 32);
0
Ritor1
parents:
diff changeset
5944 v29->field_C = 2;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5945 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5946 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5947 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5948 if ( actor->pMonsterInfo.uMovementType == 2 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5949 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5950 Actor::AI_4032B2(uActorID, a2a, 5120, 32);
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5951 v29->field_C = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5952 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5953 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5954 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5955 if ( actor->pMonsterInfo.uMovementType == 4 )
0
Ritor1
parents:
diff changeset
5956 {
1060
b79139c3b5c8 some AI cleaning
zipi
parents: 1057
diff changeset
5957 Actor::AI_4032B2(uActorID, a2a, 10240, 32);
0
Ritor1
parents:
diff changeset
5958 v29->field_C = 2;
920
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5959 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5960 return 1;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5961 }
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5962 if ( actor->pMonsterInfo.uMovementType == 5 )
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5963 {
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5964 Actor::AI_Stand(uActorID, a2a, 32, 0);
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5965 v29->field_C = 2;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5966 v29->uActionLength = actor->uCurrentActionLength;
34ed2d5e7cfb MagicShopDialog clean and other
Ritor1
parents: 916
diff changeset
5967 return 1;
0
Ritor1
parents:
diff changeset
5968 }
Ritor1
parents:
diff changeset
5969 return 1;
Ritor1
parents:
diff changeset
5970 }
Ritor1
parents:
diff changeset
5971
Ritor1
parents:
diff changeset
5972 //----- (00406FA8) --------------------------------------------------------
Ritor1
parents:
diff changeset
5973 void stru262_TurnBased::_406FA8()
Ritor1
parents:
diff changeset
5974 {
Ritor1
parents:
diff changeset
5975 unsigned __int8 v1; // zf@1
Ritor1
parents:
diff changeset
5976 unsigned __int8 v2; // sf@1
Ritor1
parents:
diff changeset
5977 TurnBased_QueueElem *v3; // edi@2
Ritor1
parents:
diff changeset
5978 int v4; // eax@4
Ritor1
parents:
diff changeset
5979 Actor *v5; // ebx@4
Ritor1
parents:
diff changeset
5980 unsigned __int16 v6; // cx@4
Ritor1
parents:
diff changeset
5981 unsigned int *v7; // edx@8
Ritor1
parents:
diff changeset
5982 unsigned int v8; // esi@8
Ritor1
parents:
diff changeset
5983 unsigned __int8 v9; // of@13
Ritor1
parents:
diff changeset
5984 AIDirection a3; // [sp+Ch] [bp-6Ch]@8
Ritor1
parents:
diff changeset
5985 AIDirection v11; // [sp+28h] [bp-50h]@8
Ritor1
parents:
diff changeset
5986 AIDirection a4; // [sp+44h] [bp-34h]@8
Ritor1
parents:
diff changeset
5987 stru262_TurnBased *v13; // [sp+60h] [bp-18h]@1
Ritor1
parents:
diff changeset
5988 TurnBased_QueueElem *v14; // [sp+64h] [bp-14h]@2
Ritor1
parents:
diff changeset
5989 int uActorID; // [sp+68h] [bp-10h]@4
Ritor1
parents:
diff changeset
5990 unsigned int a2; // [sp+6Ch] [bp-Ch]@8
Ritor1
parents:
diff changeset
5991 int v17; // [sp+70h] [bp-8h]@1
Ritor1
parents:
diff changeset
5992 unsigned int v18; // [sp+74h] [bp-4h]@2
Ritor1
parents:
diff changeset
5993
Ritor1
parents:
diff changeset
5994 v17 = 0;
Ritor1
parents:
diff changeset
5995 v1 = this->uActorQueueSize == 0;
Ritor1
parents:
diff changeset
5996 v2 = this->uActorQueueSize < 0;
Ritor1
parents:
diff changeset
5997 v13 = this;
Ritor1
parents:
diff changeset
5998 if ( !(v2 | v1) )
Ritor1
parents:
diff changeset
5999 {
Ritor1
parents:
diff changeset
6000 v3 = this->pQueue;
Ritor1
parents:
diff changeset
6001 v18 = (char *)&pTurnEngine - (char *)this;
Ritor1
parents:
diff changeset
6002 v14 = this->pQueue;
Ritor1
parents:
diff changeset
6003 do
Ritor1
parents:
diff changeset
6004 {
828
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
6005 if (PID_TYPE(v3->uPackedID) != OBJECT_Player)
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
6006 {
0f56abdcce94 Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents: 824
diff changeset
6007 v4 = PID_ID(v3->uPackedID);
0
Ritor1
parents:
diff changeset
6008 uActorID = v4;
Ritor1
parents:
diff changeset
6009 v5 = &pActors[v4];
Ritor1
parents:
diff changeset
6010 v6 = v5->uAIState;
Ritor1
parents:
diff changeset
6011 if ( v6 != 5 )
Ritor1
parents:
diff changeset
6012 {
Ritor1
parents:
diff changeset
6013 if ( v6 != 11 )
Ritor1
parents:
diff changeset
6014 {
Ritor1
parents:
diff changeset
6015 if ( v6 != 19 )
Ritor1
parents:
diff changeset
6016 {
Ritor1
parents:
diff changeset
6017 if ( v6 != 17 )
Ritor1
parents:
diff changeset
6018 {
417
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
6019 v7 = (unsigned int *)&ai_near_actors_targets_pid[v4];
0
Ritor1
parents:
diff changeset
6020 a2 = *v7;
Ritor1
parents:
diff changeset
6021 v8 = a2;
417
55684f4eda73 Actor::SelectTarget & ai_near_actors_targets_pid
Nomad
parents: 414
diff changeset
6022 Actor::_SelectTarget(v4, (int *)v7, true);
0
Ritor1
parents:
diff changeset
6023 memcpy(&v11, Actor::GetDirectionInfo(*(int *)((char *)&v3->uPackedID + v18), v8, &a3, 0), sizeof(v11));
Ritor1
parents:
diff changeset
6024 memcpy(&a4, &v11, sizeof(a4));
Ritor1
parents:
diff changeset
6025 v5->uCurrentActionTime += pMiscTimer->uTimeElapsed;
Ritor1
parents:
diff changeset
6026 if ( (signed int)v5->uCurrentActionTime >= v5->uCurrentActionLength )
Ritor1
parents:
diff changeset
6027 {
Ritor1
parents:
diff changeset
6028 if (v5->uAIState == Dying)
Ritor1
parents:
diff changeset
6029 {
Ritor1
parents:
diff changeset
6030 v5->uCurrentActionTime = 0;
Ritor1
parents:
diff changeset
6031 v5->uCurrentActionLength = 0;
Ritor1
parents:
diff changeset
6032 v5->uAIState = Dead;
Ritor1
parents:
diff changeset
6033 v5->UpdateAnimation();
Ritor1
parents:
diff changeset
6034 return;
Ritor1
parents:
diff changeset
6035 }
Ritor1
parents:
diff changeset
6036 if ( rand() % 2 )
413
111f25d1cc04 AI_Stand
Nomad
parents: 405
diff changeset
6037 Actor::AI_Stand(uActorID, a2, 0x40u, &a4);
0
Ritor1
parents:
diff changeset
6038 else
414
d8b3056df4e2 AI_Bored
Nomad
parents: 413
diff changeset
6039 Actor::AI_Bored(uActorID, a2, &a4);
0
Ritor1
parents:
diff changeset
6040 }
Ritor1
parents:
diff changeset
6041 }
Ritor1
parents:
diff changeset
6042 }
Ritor1
parents:
diff changeset
6043 }
Ritor1
parents:
diff changeset
6044 }
Ritor1
parents:
diff changeset
6045 }
Ritor1
parents:
diff changeset
6046 ++v17;
Ritor1
parents:
diff changeset
6047 v3 = v14 + 1;
Ritor1
parents:
diff changeset
6048 v9 = __OFSUB__(v17, v13->uActorQueueSize);
Ritor1
parents:
diff changeset
6049 v2 = v17 - v13->uActorQueueSize < 0;
Ritor1
parents:
diff changeset
6050 ++v14;
Ritor1
parents:
diff changeset
6051 }
Ritor1
parents:
diff changeset
6052 while ( v2 ^ v9 );
Ritor1
parents:
diff changeset
6053 }
Ritor1
parents:
diff changeset
6054 }
Ritor1
parents:
diff changeset
6055
Ritor1
parents:
diff changeset
6056 //----- (004070EF) --------------------------------------------------------
Ritor1
parents:
diff changeset
6057 bool __fastcall sub_4070EF_prolly_collide_objects(unsigned int uObjID, unsigned int uObj2ID)
Ritor1
parents:
diff changeset
6058 {
Ritor1
parents:
diff changeset
6059 signed int v2; // eax@1
Ritor1
parents:
diff changeset
6060 unsigned int v3; // ecx@1
Ritor1
parents:
diff changeset
6061 signed int v4; // esi@1
Ritor1
parents:
diff changeset
6062 int v5; // ecx@2
Ritor1
parents:
diff changeset
6063 signed int v6; // eax@4
Ritor1
parents:
diff changeset
6064 int v7; // eax@4
Ritor1
parents:
diff changeset
6065 float v8; // ST24_4@5
Ritor1
parents:
diff changeset
6066 double v9; // ST18_8@5
Ritor1
parents:
diff changeset
6067 signed int v10; // eax@6
Ritor1
parents:
diff changeset
6068 int v11; // ecx@6
Ritor1
parents:
diff changeset
6069 signed int v12; // eax@7
Ritor1
parents:
diff changeset
6070 int v13; // esi@7
Ritor1
parents:
diff changeset
6071 int v14; // esi@8
Ritor1
parents:
diff changeset
6072 int v15; // esi@9
Ritor1
parents:
diff changeset
6073 signed int v16; // eax@11
Ritor1
parents:
diff changeset
6074 int v17; // edi@11
Ritor1
parents:
diff changeset
6075 int v18; // esi@11
Ritor1
parents:
diff changeset
6076 int v19; // eax@13
Ritor1
parents:
diff changeset
6077 float v20; // ST24_4@14
Ritor1
parents:
diff changeset
6078 double v21; // ST18_8@14
Ritor1
parents:
diff changeset
6079 signed int v22; // eax@15
Ritor1
parents:
diff changeset
6080 int v23; // ebx@16
Ritor1
parents:
diff changeset
6081 signed int v24; // ecx@16
Ritor1
parents:
diff changeset
6082 int v25; // eax@18
Ritor1
parents:
diff changeset
6083 int v26; // eax@28
Ritor1
parents:
diff changeset
6084 BLVSector *v27; // edx@31
Ritor1
parents:
diff changeset
6085 int v28; // ecx@31
Ritor1
parents:
diff changeset
6086 BLVFace *v29; // ebx@32
Ritor1
parents:
diff changeset
6087 Vec3_short_ *v30; // esi@32
Ritor1
parents:
diff changeset
6088 int v31; // eax@32
Ritor1
parents:
diff changeset
6089 int v32; // ST50_4@44
Ritor1
parents:
diff changeset
6090 int v33; // ST54_4@44
Ritor1
parents:
diff changeset
6091 int v34; // eax@44
Ritor1
parents:
diff changeset
6092 char v35; // zf@44
Ritor1
parents:
diff changeset
6093 int v36; // edi@44
Ritor1
parents:
diff changeset
6094 int v37; // eax@45
Ritor1
parents:
diff changeset
6095 signed int v38; // esi@45
Ritor1
parents:
diff changeset
6096 int v39; // ST4C_4@49
Ritor1
parents:
diff changeset
6097 signed __int64 v40; // qtt@50
Ritor1
parents:
diff changeset
6098 __int16 v42; // bx@58
Ritor1
parents:
diff changeset
6099 int v43; // [sp-8h] [bp-70h]@11
Ritor1
parents:
diff changeset
6100 int v44; // [sp-4h] [bp-6Ch]@11
Ritor1
parents:
diff changeset
6101 int v45; // [sp+Ch] [bp-5Ch]@32
Ritor1
parents:
diff changeset
6102 __int16 v46; // [sp+10h] [bp-58h]@32
Ritor1
parents:
diff changeset
6103 int v47; // [sp+18h] [bp-50h]@20
Ritor1
parents:
diff changeset
6104 int v48; // [sp+1Ch] [bp-4Ch]@20
Ritor1
parents:
diff changeset
6105 int v49; // [sp+20h] [bp-48h]@20
Ritor1
parents:
diff changeset
6106 int v50; // [sp+24h] [bp-44h]@16
Ritor1
parents:
diff changeset
6107 signed int v51; // [sp+24h] [bp-44h]@27
Ritor1
parents:
diff changeset
6108 signed int v52; // [sp+28h] [bp-40h]@26
Ritor1
parents:
diff changeset
6109 signed int v53; // [sp+2Ch] [bp-3Ch]@23
Ritor1
parents:
diff changeset
6110 signed int v54; // [sp+30h] [bp-38h]@22
Ritor1
parents:
diff changeset
6111 signed int v55; // [sp+34h] [bp-34h]@21
Ritor1
parents:
diff changeset
6112 signed int v56; // [sp+38h] [bp-30h]@20
Ritor1
parents:
diff changeset
6113 signed int v57; // [sp+3Ch] [bp-2Ch]@28
Ritor1
parents:
diff changeset
6114 int v58; // [sp+44h] [bp-24h]@50
Ritor1
parents:
diff changeset
6115 int v59; // [sp+48h] [bp-20h]@44
Ritor1
parents:
diff changeset
6116 int v60; // [sp+50h] [bp-18h]@11
Ritor1
parents:
diff changeset
6117 signed int v61; // [sp+50h] [bp-18h]@31
Ritor1
parents:
diff changeset
6118 int v62; // [sp+54h] [bp-14h]@16
Ritor1
parents:
diff changeset
6119 int v63; // [sp+58h] [bp-10h]@4
Ritor1
parents:
diff changeset
6120 int v64; // [sp+5Ch] [bp-Ch]@4
Ritor1
parents:
diff changeset
6121 int v65; // [sp+60h] [bp-8h]@4
Ritor1
parents:
diff changeset
6122 int v66; // [sp+64h] [bp-4h]@7
Ritor1
parents:
diff changeset
6123
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
6124 v2 = PID_ID(uObjID);
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
6125 v3 = PID_TYPE(uObjID) - 2;
0
Ritor1
parents:
diff changeset
6126 v4 = uObj2ID;
Ritor1
parents:
diff changeset
6127 if ( v3 )
Ritor1
parents:
diff changeset
6128 {
Ritor1
parents:
diff changeset
6129 v5 = v3 - 1;
Ritor1
parents:
diff changeset
6130 if ( v5 )
Ritor1
parents:
diff changeset
6131 {
Ritor1
parents:
diff changeset
6132 if ( v5 != 2 )
Ritor1
parents:
diff changeset
6133 return 0;
Ritor1
parents:
diff changeset
6134 v6 = v2;
Ritor1
parents:
diff changeset
6135 v63 = pLevelDecorations[v6].vPosition.x;
Ritor1
parents:
diff changeset
6136 v64 = pLevelDecorations[v6].vPosition.y;
Ritor1
parents:
diff changeset
6137 v65 = pLevelDecorations[v6].vPosition.z;
Ritor1
parents:
diff changeset
6138 v7 = pIndoor->GetSector(v63, v64, v65);
Ritor1
parents:
diff changeset
6139 }
Ritor1
parents:
diff changeset
6140 else
Ritor1
parents:
diff changeset
6141 {
Ritor1
parents:
diff changeset
6142 v63 = pActors[v2].vPosition.x;
Ritor1
parents:
diff changeset
6143 v64 = pActors[v2].vPosition.y;
Ritor1
parents:
diff changeset
6144 v8 = (double)pActors[v2].uActorHeight * 0.69999999;
Ritor1
parents:
diff changeset
6145 v9 = v8 + 6.7553994e15;
Ritor1
parents:
diff changeset
6146 v65 = LODWORD(v9) + pActors[v2].vPosition.z;
Ritor1
parents:
diff changeset
6147 v7 = pActors[v2].uSectorID;
Ritor1
parents:
diff changeset
6148 }
Ritor1
parents:
diff changeset
6149 }
Ritor1
parents:
diff changeset
6150 else
Ritor1
parents:
diff changeset
6151 {
Ritor1
parents:
diff changeset
6152 v10 = v2;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6153 v63 = pSpriteObjects[v10].vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6154 v64 = pSpriteObjects[v10].vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6155 v11 = pSpriteObjects[v10].vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6156 v7 = pSpriteObjects[v10].uSectorID;
0
Ritor1
parents:
diff changeset
6157 v65 = v11;
Ritor1
parents:
diff changeset
6158 }
Ritor1
parents:
diff changeset
6159 v66 = v7;
848
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
6160 v12 = PID_ID(v4);
ceef50611567 * AI fixed (temporary)
zipi
parents: 839
diff changeset
6161 v13 = PID_TYPE(v4) - 2;
0
Ritor1
parents:
diff changeset
6162 if ( v13 )
Ritor1
parents:
diff changeset
6163 {
Ritor1
parents:
diff changeset
6164 v14 = v13 - 1;
Ritor1
parents:
diff changeset
6165 if ( v14 )
Ritor1
parents:
diff changeset
6166 {
Ritor1
parents:
diff changeset
6167 v15 = v14 - 1;
Ritor1
parents:
diff changeset
6168 if ( v15 )
Ritor1
parents:
diff changeset
6169 {
Ritor1
parents:
diff changeset
6170 if ( v15 != 1 )
Ritor1
parents:
diff changeset
6171 return 0;
Ritor1
parents:
diff changeset
6172 v16 = v12;
Ritor1
parents:
diff changeset
6173 v17 = pLevelDecorations[v16].vPosition.z;
Ritor1
parents:
diff changeset
6174 v18 = pLevelDecorations[v16].vPosition.x;
Ritor1
parents:
diff changeset
6175 v44 = pLevelDecorations[v16].vPosition.z;
Ritor1
parents:
diff changeset
6176 v60 = pLevelDecorations[v16].vPosition.y;
Ritor1
parents:
diff changeset
6177 v43 = pLevelDecorations[v16].vPosition.y;
Ritor1
parents:
diff changeset
6178 }
Ritor1
parents:
diff changeset
6179 else
Ritor1
parents:
diff changeset
6180 {
Ritor1
parents:
diff changeset
6181 v18 = pParty->vPosition.x;
Ritor1
parents:
diff changeset
6182 v17 = pParty->sEyelevel + pParty->vPosition.z;
Ritor1
parents:
diff changeset
6183 v60 = pParty->vPosition.y;
Ritor1
parents:
diff changeset
6184 v44 = pParty->sEyelevel + pParty->vPosition.z;
Ritor1
parents:
diff changeset
6185 v43 = pParty->vPosition.y;
Ritor1
parents:
diff changeset
6186 }
Ritor1
parents:
diff changeset
6187 v19 = pIndoor->GetSector(v18, v43, v44);
Ritor1
parents:
diff changeset
6188 }
Ritor1
parents:
diff changeset
6189 else
Ritor1
parents:
diff changeset
6190 {
Ritor1
parents:
diff changeset
6191 v60 = pActors[v12].vPosition.y;
Ritor1
parents:
diff changeset
6192 v18 = pActors[v12].vPosition.x;
Ritor1
parents:
diff changeset
6193 v20 = (double)pActors[v12].uActorHeight * 0.69999999;
Ritor1
parents:
diff changeset
6194 v21 = v20 + 6.7553994e15;
Ritor1
parents:
diff changeset
6195 v17 = LODWORD(v21) + pActors[v12].vPosition.z;
Ritor1
parents:
diff changeset
6196 v19 = pActors[v12].uSectorID;
Ritor1
parents:
diff changeset
6197 }
Ritor1
parents:
diff changeset
6198 }
Ritor1
parents:
diff changeset
6199 else
Ritor1
parents:
diff changeset
6200 {
Ritor1
parents:
diff changeset
6201 v22 = v12;
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6202 v18 = pSpriteObjects[v22].vPosition.x;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6203 v17 = pSpriteObjects[v22].vPosition.z;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6204 v60 = pSpriteObjects[v22].vPosition.y;
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 513
diff changeset
6205 v19 = pSpriteObjects[v22].uSectorID;
0
Ritor1
parents:
diff changeset
6206 }
Ritor1
parents:
diff changeset
6207 v62 = v19;
Ritor1
parents:
diff changeset
6208 v23 = v18 - v63;
Ritor1
parents:
diff changeset
6209 v50 = v17 - v65;
295
640a176c030f sub_42ECB5
Nomad
parents: 275
diff changeset
6210 v24 = integer_sqrt(v23 * v23 + (v60 - v64) * (v60 - v64) + v50 * v50);
0
Ritor1
parents:
diff changeset
6211 if ( v24 > 5120 )
Ritor1
parents:
diff changeset
6212 return 0;
Ritor1
parents:
diff changeset
6213 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
Ritor1
parents:
diff changeset
6214 return 1;
Ritor1
parents:
diff changeset
6215 v25 = 65536;
Ritor1
parents:
diff changeset
6216 if ( v24 )
Ritor1
parents:
diff changeset
6217 v25 = 65536 / v24;
Ritor1
parents:
diff changeset
6218 v49 = v23 * v25;
Ritor1
parents:
diff changeset
6219 v47 = v50 * v25;
Ritor1
parents:
diff changeset
6220 v48 = (v60 - v64) * v25;
Ritor1
parents:
diff changeset
6221 v56 = v63;
Ritor1
parents:
diff changeset
6222 if ( v63 < v18 )
Ritor1
parents:
diff changeset
6223 {
Ritor1
parents:
diff changeset
6224 v55 = v18;
Ritor1
parents:
diff changeset
6225 }
Ritor1
parents:
diff changeset
6226 else
Ritor1
parents:
diff changeset
6227 {
Ritor1
parents:
diff changeset
6228 v56 = v18;
Ritor1
parents:
diff changeset
6229 v55 = v63;
Ritor1
parents:
diff changeset
6230 }
Ritor1
parents:
diff changeset
6231 v54 = v64;
Ritor1
parents:
diff changeset
6232 if ( v64 < v60 )
Ritor1
parents:
diff changeset
6233 {
Ritor1
parents:
diff changeset
6234 v53 = v60;
Ritor1
parents:
diff changeset
6235 }
Ritor1
parents:
diff changeset
6236 else
Ritor1
parents:
diff changeset
6237 {
Ritor1
parents:
diff changeset
6238 v54 = v60;
Ritor1
parents:
diff changeset
6239 v53 = v64;
Ritor1
parents:
diff changeset
6240 }
Ritor1
parents:
diff changeset
6241 v52 = v65;
Ritor1
parents:
diff changeset
6242 if ( v65 < v17 )
Ritor1
parents:
diff changeset
6243 {
Ritor1
parents:
diff changeset
6244 v51 = v17;
Ritor1
parents:
diff changeset
6245 }
Ritor1
parents:
diff changeset
6246 else
Ritor1
parents:
diff changeset
6247 {
Ritor1
parents:
diff changeset
6248 v52 = v17;
Ritor1
parents:
diff changeset
6249 v51 = v65;
Ritor1
parents:
diff changeset
6250 }
Ritor1
parents:
diff changeset
6251 v57 = 0;
Ritor1
parents:
diff changeset
6252 v26 = v66;
Ritor1
parents:
diff changeset
6253 while ( 2 )
Ritor1
parents:
diff changeset
6254 {
Ritor1
parents:
diff changeset
6255 if ( v26 == v62 )
Ritor1
parents:
diff changeset
6256 return 1;
Ritor1
parents:
diff changeset
6257 if ( v57 >= 30 || (v27 = pIndoor->pSectors, v28 = v66, v61 = 0, pIndoor->pSectors[v66].uNumPortals <= 0) )
Ritor1
parents:
diff changeset
6258 break;
Ritor1
parents:
diff changeset
6259 while ( 1 )
Ritor1
parents:
diff changeset
6260 {
Ritor1
parents:
diff changeset
6261 v29 = &pIndoor->pFaces[v27[v28].pPortals[v61]];
Ritor1
parents:
diff changeset
6262 v30 = &pIndoor->pVertices[*v29->pVertexIDs];
Ritor1
parents:
diff changeset
6263 v45 = *(int *)&v30->x;
Ritor1
parents:
diff changeset
6264 v46 = v30->z;
Ritor1
parents:
diff changeset
6265 v31 = v29->pFacePlane_old.vNormal.z * (v46 - v65)
Ritor1
parents:
diff changeset
6266 + v29->pFacePlane_old.vNormal.y * (SHIWORD(v45) - v64)
Ritor1
parents:
diff changeset
6267 + v29->pFacePlane_old.vNormal.x * ((signed __int16)v45 - v63);
Ritor1
parents:
diff changeset
6268 if ( v66 != v29->uSectorID )
Ritor1
parents:
diff changeset
6269 v31 = -v31;
Ritor1
parents:
diff changeset
6270 if ( v31 >= 0 && (signed __int16)v45 != v63 && SHIWORD(v45) != v64 && v46 != v65
Ritor1
parents:
diff changeset
6271 || v56 > v29->pBounding.x2
Ritor1
parents:
diff changeset
6272 || v55 < v29->pBounding.x1
Ritor1
parents:
diff changeset
6273 || v54 > v29->pBounding.y2
Ritor1
parents:
diff changeset
6274 || v53 < v29->pBounding.y1
Ritor1
parents:
diff changeset
6275 || v52 > v29->pBounding.z2
Ritor1
parents:
diff changeset
6276 || v51 < v29->pBounding.z1 )
Ritor1
parents:
diff changeset
6277 goto LABEL_54;
Ritor1
parents:
diff changeset
6278 v32 = (unsigned __int64)(v49 * (signed __int64)v29->pFacePlane_old.vNormal.x) >> 16;
Ritor1
parents:
diff changeset
6279 v33 = (unsigned __int64)(v47 * (signed __int64)v29->pFacePlane_old.vNormal.z) >> 16;
Ritor1
parents:
diff changeset
6280 v34 = (unsigned __int64)(v48 * (signed __int64)v29->pFacePlane_old.vNormal.y) >> 16;
Ritor1
parents:
diff changeset
6281 v35 = v32 + v33 + v34 == 0;
Ritor1
parents:
diff changeset
6282 v36 = v32 + v33 + v34;
Ritor1
parents:
diff changeset
6283 v59 = v32 + v33 + v34;
Ritor1
parents:
diff changeset
6284 if ( v35 )
Ritor1
parents:
diff changeset
6285 goto LABEL_53;
Ritor1
parents:
diff changeset
6286 v37 = v65 * v29->pFacePlane_old.vNormal.z;
Ritor1
parents:
diff changeset
6287 v38 = -(v29->pFacePlane_old.dist + v37 + v63 * v29->pFacePlane_old.vNormal.x + v64 * v29->pFacePlane_old.vNormal.y);
Ritor1
parents:
diff changeset
6288 if ( v36 <= 0 )
Ritor1
parents:
diff changeset
6289 break;
Ritor1
parents:
diff changeset
6290 if ( v29->pFacePlane_old.dist + v37 + v63 * v29->pFacePlane_old.vNormal.x + v64 * v29->pFacePlane_old.vNormal.y <= 0 )
Ritor1
parents:
diff changeset
6291 goto LABEL_49;
Ritor1
parents:
diff changeset
6292 LABEL_53:
Ritor1
parents:
diff changeset
6293 v27 = pIndoor->pSectors;
Ritor1
parents:
diff changeset
6294 LABEL_54:
Ritor1
parents:
diff changeset
6295 ++v61;
Ritor1
parents:
diff changeset
6296 if ( v61 >= v27[v28].uNumPortals )
Ritor1
parents:
diff changeset
6297 goto LABEL_55;
Ritor1
parents:
diff changeset
6298 }
Ritor1
parents:
diff changeset
6299 if ( v29->pFacePlane_old.dist + v37 + v63 * v29->pFacePlane_old.vNormal.x + v64 * v29->pFacePlane_old.vNormal.y < 0 )
Ritor1
parents:
diff changeset
6300 goto LABEL_53;
Ritor1
parents:
diff changeset
6301 LABEL_49:
Ritor1
parents:
diff changeset
6302 v39 = abs(-(v29->pFacePlane_old.dist
Ritor1
parents:
diff changeset
6303 + v37
Ritor1
parents:
diff changeset
6304 + v63 * v29->pFacePlane_old.vNormal.x
Ritor1
parents:
diff changeset
6305 + v64 * v29->pFacePlane_old.vNormal.y)) >> 14;
Ritor1
parents:
diff changeset
6306 if ( v39 > abs(v36)
Ritor1
parents:
diff changeset
6307 || (LODWORD(v40) = v38 << 16, HIDWORD(v40) = v38 >> 16, v58 = v40 / v59, (signed int)(v40 / v59) < 0)
Ritor1
parents:
diff changeset
6308 || !sub_4075DB(
Ritor1
parents:
diff changeset
6309 v63 + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v49) >> 16) + 32768) >> 16),
Ritor1
parents:
diff changeset
6310 v64 + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v48) >> 16) + 32768) >> 16),
Ritor1
parents:
diff changeset
6311 v65 + ((signed int)(((unsigned __int64)(v58 * (signed __int64)v47) >> 16) + 32768) >> 16),
Ritor1
parents:
diff changeset
6312 v29) )
Ritor1
parents:
diff changeset
6313 {
Ritor1
parents:
diff changeset
6314 v28 = v66;
Ritor1
parents:
diff changeset
6315 goto LABEL_53;
Ritor1
parents:
diff changeset
6316 }
Ritor1
parents:
diff changeset
6317 if ( v29->uSectorID == v66 )
Ritor1
parents:
diff changeset
6318 v42 = v29->uBackSectorID;
Ritor1
parents:
diff changeset
6319 else
Ritor1
parents:
diff changeset
6320 v42 = v29->uSectorID;
Ritor1
parents:
diff changeset
6321 v26 = v42;
Ritor1
parents:
diff changeset
6322 if ( v42 != v66 )
Ritor1
parents:
diff changeset
6323 {
Ritor1
parents:
diff changeset
6324 ++v57;
Ritor1
parents:
diff changeset
6325 v66 = v42;
Ritor1
parents:
diff changeset
6326 continue;
Ritor1
parents:
diff changeset
6327 }
Ritor1
parents:
diff changeset
6328 break;
Ritor1
parents:
diff changeset
6329 }
Ritor1
parents:
diff changeset
6330 LABEL_55:
Ritor1
parents:
diff changeset
6331 if ( v66 != v62 )
Ritor1
parents:
diff changeset
6332 return 0;
Ritor1
parents:
diff changeset
6333 return 1;
Ritor1
parents:
diff changeset
6334 }
Ritor1
parents:
diff changeset
6335
Ritor1
parents:
diff changeset
6336 //----- (004075DB) --------------------------------------------------------
Ritor1
parents:
diff changeset
6337 bool __fastcall sub_4075DB(int a1, int a2, int a3, BLVFace *a4)
Ritor1
parents:
diff changeset
6338 {
Ritor1
parents:
diff changeset
6339 BLVFace *v4; // eax@1
Ritor1
parents:
diff changeset
6340 unsigned int v5; // esi@1
Ritor1
parents:
diff changeset
6341 signed int v6; // esi@2
Ritor1
parents:
diff changeset
6342 char v7; // zf@2
Ritor1
parents:
diff changeset
6343 int v8; // edi@2
Ritor1
parents:
diff changeset
6344 Vec3_short_ *v9; // ecx@3
Ritor1
parents:
diff changeset
6345 int v10; // edx@4
Ritor1
parents:
diff changeset
6346 signed int v11; // esi@7
Ritor1
parents:
diff changeset
6347 Vec3_short_ *v12; // ecx@8
Ritor1
parents:
diff changeset
6348 int v13; // edx@9
Ritor1
parents:
diff changeset
6349 signed int v14; // esi@11
Ritor1
parents:
diff changeset
6350 Vec3_short_ *v15; // ecx@12
Ritor1
parents:
diff changeset
6351 int v16; // edx@13
Ritor1
parents:
diff changeset
6352 int v17; // eax@14
Ritor1
parents:
diff changeset
6353 bool v18; // esi@14
Ritor1
parents:
diff changeset
6354 int v19; // ecx@14
Ritor1
parents:
diff changeset
6355 int v20; // ecx@16
Ritor1
parents:
diff changeset
6356 int v21; // edx@16
Ritor1
parents:
diff changeset
6357 int v22; // eax@17
Ritor1
parents:
diff changeset
6358 signed int v23; // ebx@18
Ritor1
parents:
diff changeset
6359 int v24; // esi@20
Ritor1
parents:
diff changeset
6360 signed int v25; // eax@22
Ritor1
parents:
diff changeset
6361 signed __int64 v26; // qtt@22
Ritor1
parents:
diff changeset
6362 bool result; // eax@25
Ritor1
parents:
diff changeset
6363 int v28; // [sp+8h] [bp-14h]@14
Ritor1
parents:
diff changeset
6364 int v29; // [sp+10h] [bp-Ch]@14
Ritor1
parents:
diff changeset
6365 signed int a3a; // [sp+24h] [bp+8h]@14
Ritor1
parents:
diff changeset
6366 int a4a; // [sp+28h] [bp+Ch]@2
Ritor1
parents:
diff changeset
6367
Ritor1
parents:
diff changeset
6368 v4 = a4;
Ritor1
parents:
diff changeset
6369 v5 = a4->uAttributes;
Ritor1
parents:
diff changeset
6370 if ( v5 & 0x100 )
Ritor1
parents:
diff changeset
6371 {
Ritor1
parents:
diff changeset
6372 v6 = 0;
Ritor1
parents:
diff changeset
6373 v7 = a4->uNumVertices == 0;
Ritor1
parents:
diff changeset
6374 a4a = a1;
Ritor1
parents:
diff changeset
6375 v8 = a2;
Ritor1
parents:
diff changeset
6376 if ( !v7 )
Ritor1
parents:
diff changeset
6377 {
Ritor1
parents:
diff changeset
6378 v9 = pIndoor->pVertices;
Ritor1
parents:
diff changeset
6379 do
Ritor1
parents:
diff changeset
6380 {
Ritor1
parents:
diff changeset
6381 dword_4F5D98_xs[v6] = v9[v4->pVertexIDs[v6]].x;
Ritor1
parents:
diff changeset
6382 v10 = v4->pVertexIDs[v6++];
Ritor1
parents:
diff changeset
6383 dword_4F5CC4_ys[v6] = v9[v10].y;
Ritor1
parents:
diff changeset
6384 }
Ritor1
parents:
diff changeset
6385 while ( v6 < v4->uNumVertices );
Ritor1
parents:
diff changeset
6386 }
Ritor1
parents:
diff changeset
6387 }
Ritor1
parents:
diff changeset
6388 else
Ritor1
parents:
diff changeset
6389 {
Ritor1
parents:
diff changeset
6390 v8 = a3;
Ritor1
parents:
diff changeset
6391 if ( v5 & 0x200 )
Ritor1
parents:
diff changeset
6392 {
Ritor1
parents:
diff changeset
6393 v11 = 0;
Ritor1
parents:
diff changeset
6394 v7 = a4->uNumVertices == 0;
Ritor1
parents:
diff changeset
6395 a4a = a1;
Ritor1
parents:
diff changeset
6396 if ( !v7 )
Ritor1
parents:
diff changeset
6397 {
Ritor1
parents:
diff changeset
6398 v12 = pIndoor->pVertices;
Ritor1
parents:
diff changeset
6399 do
Ritor1
parents:
diff changeset
6400 {
Ritor1
parents:
diff changeset
6401 dword_4F5D98_xs[v11] = v12[v4->pVertexIDs[v11]].x;
Ritor1
parents:
diff changeset
6402 v13 = v4->pVertexIDs[v11++];
Ritor1
parents:
diff changeset
6403 dword_4F5CC4_ys[v11] = v12[v13].z;
Ritor1
parents:
diff changeset
6404 }
Ritor1
parents:
diff changeset
6405 while ( v11 < v4->uNumVertices );
Ritor1
parents:
diff changeset
6406 }
Ritor1
parents:
diff changeset
6407 }
Ritor1
parents:
diff changeset
6408 else
Ritor1
parents:
diff changeset
6409 {
Ritor1
parents:
diff changeset
6410 v14 = 0;
Ritor1
parents:
diff changeset
6411 v7 = a4->uNumVertices == 0;
Ritor1
parents:
diff changeset
6412 a4a = a2;
Ritor1
parents:
diff changeset
6413 if ( !v7 )
Ritor1
parents:
diff changeset
6414 {
Ritor1
parents:
diff changeset
6415 v15 = pIndoor->pVertices;
Ritor1
parents:
diff changeset
6416 do
Ritor1
parents:
diff changeset
6417 {
Ritor1
parents:
diff changeset
6418 dword_4F5D98_xs[v14] = v15[v4->pVertexIDs[v14]].y;
Ritor1
parents:
diff changeset
6419 v16 = v4->pVertexIDs[v14++];
Ritor1
parents:
diff changeset
6420 dword_4F5CC4_ys[v14] = v15[v16].z;
Ritor1
parents:
diff changeset
6421 }
Ritor1
parents:
diff changeset
6422 while ( v14 < v4->uNumVertices );
Ritor1
parents:
diff changeset
6423 }
Ritor1
parents:
diff changeset
6424 }
Ritor1
parents:
diff changeset
6425 }
Ritor1
parents:
diff changeset
6426 v17 = v4->uNumVertices;
Ritor1
parents:
diff changeset
6427 a3a = 0;
Ritor1
parents:
diff changeset
6428 dword_4F5D98_xs[v17] = dword_4F5D98_xs[0];
Ritor1
parents:
diff changeset
6429 dword_4F5CC4_ys[v17 + 1] = dword_4F5CC4_ys[1];
Ritor1
parents:
diff changeset
6430 v28 = v17;
Ritor1
parents:
diff changeset
6431 v18 = dword_4F5CC4_ys[1] >= v8;
Ritor1
parents:
diff changeset
6432 v19 = 0;
Ritor1
parents:
diff changeset
6433 v29 = 0;
Ritor1
parents:
diff changeset
6434 if ( v17 <= 0 )
Ritor1
parents:
diff changeset
6435 goto LABEL_29;
Ritor1
parents:
diff changeset
6436 do
Ritor1
parents:
diff changeset
6437 {
Ritor1
parents:
diff changeset
6438 if ( a3a >= 2 )
Ritor1
parents:
diff changeset
6439 break;
Ritor1
parents:
diff changeset
6440 v20 = v19;
Ritor1
parents:
diff changeset
6441 v21 = dword_4F5CC4_ys[v20 + 2];
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1108
diff changeset
6442 if ( v18 ^ (v21 >= v8) )
0
Ritor1
parents:
diff changeset
6443 {
Ritor1
parents:
diff changeset
6444 v22 = dword_4F5D98_xs[v20 + 1];
Ritor1
parents:
diff changeset
6445 if ( v22 >= a4a )
Ritor1
parents:
diff changeset
6446 v23 = 0;
Ritor1
parents:
diff changeset
6447 else
Ritor1
parents:
diff changeset
6448 v23 = 2;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1108
diff changeset
6449 v24 = v23 | (dword_4F5D98_xs[v20] < a4a);
0
Ritor1
parents:
diff changeset
6450 if ( v24 != 3 )
Ritor1
parents:
diff changeset
6451 {
Ritor1
parents:
diff changeset
6452 if ( !v24
Ritor1
parents:
diff changeset
6453 || (v25 = v22 - dword_4F5D98_xs[v20],
Ritor1
parents:
diff changeset
6454 LODWORD(v26) = v25 << 16,
Ritor1
parents:
diff changeset
6455 HIDWORD(v26) = v25 >> 16,
Ritor1
parents:
diff changeset
6456 dword_4F5D98_xs[v20]
Ritor1
parents:
diff changeset
6457 + ((signed int)(((unsigned __int64)(v26
Ritor1
parents:
diff changeset
6458 / (v21 - dword_4F5CC4_ys[v20 + 1])
Ritor1
parents:
diff changeset
6459 * ((v8 - dword_4F5CC4_ys[v20 + 1]) << 16)) >> 16)
Ritor1
parents:
diff changeset
6460 + 32768) >> 16) >= a4a) )
Ritor1
parents:
diff changeset
6461 ++a3a;
Ritor1
parents:
diff changeset
6462 }
Ritor1
parents:
diff changeset
6463 }
Ritor1
parents:
diff changeset
6464 v18 = v21 >= v8;
Ritor1
parents:
diff changeset
6465 v19 = v29++ + 1;
Ritor1
parents:
diff changeset
6466 }
Ritor1
parents:
diff changeset
6467 while ( v29 < v28 );
Ritor1
parents:
diff changeset
6468 result = 1;
Ritor1
parents:
diff changeset
6469 if ( a3a != 1 )
Ritor1
parents:
diff changeset
6470 LABEL_29:
Ritor1
parents:
diff changeset
6471 result = 0;
Ritor1
parents:
diff changeset
6472 return result;
Ritor1
parents:
diff changeset
6473 }
Ritor1
parents:
diff changeset
6474
Ritor1
parents:
diff changeset
6475 //----- (004077F1) --------------------------------------------------------
Ritor1
parents:
diff changeset
6476 bool __fastcall sub_4077F1(int a1, int a2, int a3, ODMFace *a4, BSPVertexBuffer *a5)
Ritor1
parents:
diff changeset
6477 {
Ritor1
parents:
diff changeset
6478 ODMFace *v5; // eax@1
Ritor1
parents:
diff changeset
6479 unsigned int v6; // esi@1
Ritor1
parents:
diff changeset
6480 signed int v7; // edi@1
Ritor1
parents:
diff changeset
6481 char v8; // zf@2
Ritor1
parents:
diff changeset
6482 unsigned __int16 *v9; // edx@3
Ritor1
parents:
diff changeset
6483 int v10; // ecx@4
Ritor1
parents:
diff changeset
6484 unsigned __int16 *v11; // edx@8
Ritor1
parents:
diff changeset
6485 int v12; // ecx@9
Ritor1
parents:
diff changeset
6486 int v13; // edx@12
Ritor1
parents:
diff changeset
6487 int v14; // ecx@13
Ritor1
parents:
diff changeset
6488 int v15; // esi@14
Ritor1
parents:
diff changeset
6489 bool v16; // edi@14
Ritor1
parents:
diff changeset
6490 int v17; // ecx@16
Ritor1
parents:
diff changeset
6491 int v18; // edx@16
Ritor1
parents:
diff changeset
6492 int v19; // eax@17
Ritor1
parents:
diff changeset
6493 signed int v20; // ebx@18
Ritor1
parents:
diff changeset
6494 int v21; // edi@20
Ritor1
parents:
diff changeset
6495 signed int v22; // eax@22
Ritor1
parents:
diff changeset
6496 signed __int64 v23; // qtt@22
Ritor1
parents:
diff changeset
6497 bool result; // eax@25
Ritor1
parents:
diff changeset
6498 int v25; // [sp+14h] [bp-8h]@14
Ritor1
parents:
diff changeset
6499 int a4a; // [sp+28h] [bp+Ch]@2
Ritor1
parents:
diff changeset
6500 signed int a5a; // [sp+2Ch] [bp+10h]@14
Ritor1
parents:
diff changeset
6501
Ritor1
parents:
diff changeset
6502 v5 = a4;
Ritor1
parents:
diff changeset
6503 v6 = a4->uAttributes;
Ritor1
parents:
diff changeset
6504 v7 = 0;
Ritor1
parents:
diff changeset
6505 if ( v6 & 0x100 )
Ritor1
parents:
diff changeset
6506 {
Ritor1
parents:
diff changeset
6507 v8 = a4->uNumVertices == 0;
Ritor1
parents:
diff changeset
6508 a4a = a1;
Ritor1
parents:
diff changeset
6509 a3 = a2;
Ritor1
parents:
diff changeset
6510 if ( !v8 )
Ritor1
parents:
diff changeset
6511 {
Ritor1
parents:
diff changeset
6512 v9 = v5->pVertexIDs;
Ritor1
parents:
diff changeset
6513 do
Ritor1
parents:
diff changeset
6514 {
Ritor1
parents:
diff changeset
6515 ++v7;
Ritor1
parents:
diff changeset
6516 dword_4F5BF4_xs[v7] = a5->pVertices[*v9].x;
Ritor1
parents:
diff changeset
6517 v10 = *v9;
Ritor1
parents:
diff changeset
6518 ++v9;
Ritor1
parents:
diff changeset
6519 dword_4F5B24_ys[v7] = a5->pVertices[v10].y;
Ritor1
parents:
diff changeset
6520 }
Ritor1
parents:
diff changeset
6521 while ( v7 < v5->uNumVertices );
Ritor1
parents:
diff changeset
6522 }
Ritor1
parents:
diff changeset
6523 }
Ritor1
parents:
diff changeset
6524 else
Ritor1
parents:
diff changeset
6525 {
Ritor1
parents:
diff changeset
6526 if ( v6 & 0x200 )
Ritor1
parents:
diff changeset
6527 {
Ritor1
parents:
diff changeset
6528 v8 = a4->uNumVertices == 0;
Ritor1
parents:
diff changeset
6529 a4a = a1;
Ritor1
parents:
diff changeset
6530 if ( !v8 )
Ritor1
parents:
diff changeset
6531 {
Ritor1
parents:
diff changeset
6532 v11 = v5->pVertexIDs;
Ritor1
parents:
diff changeset
6533 do
Ritor1
parents:
diff changeset
6534 {
Ritor1
parents:
diff changeset
6535 ++v7;
Ritor1
parents:
diff changeset
6536 dword_4F5BF4_xs[v7] = a5->pVertices[*v11].x;
Ritor1
parents:
diff changeset
6537 v12 = *v11;
Ritor1
parents:
diff changeset
6538 ++v11;
Ritor1
parents:
diff changeset
6539 dword_4F5B24_ys[v7] = a5->pVertices[v12].z;
Ritor1
parents:
diff changeset
6540 }
Ritor1
parents:
diff changeset
6541 while ( v7 < v5->uNumVertices );
Ritor1
parents:
diff changeset
6542 }
Ritor1
parents:
diff changeset
6543 }
Ritor1
parents:
diff changeset
6544 else
Ritor1
parents:
diff changeset
6545 {
Ritor1
parents:
diff changeset
6546 v8 = a4->uNumVertices == 0;
Ritor1
parents:
diff changeset
6547 a4a = a2;
Ritor1
parents:
diff changeset
6548 if ( !v8 )
Ritor1
parents:
diff changeset
6549 {
Ritor1
parents:
diff changeset
6550 v13 = (int)v5->pVertexIDs;
Ritor1
parents:
diff changeset
6551 do
Ritor1
parents:
diff changeset
6552 {
Ritor1
parents:
diff changeset
6553 ++v7;
Ritor1
parents:
diff changeset
6554 dword_4F5BF4_xs[v7] = a5->pVertices[*(short *)v13].y;
Ritor1
parents:
diff changeset
6555 v14 = *(short *)v13;
Ritor1
parents:
diff changeset
6556 v13 += 2;
Ritor1
parents:
diff changeset
6557 dword_4F5B24_ys[v7] = a5->pVertices[v14].z;
Ritor1
parents:
diff changeset
6558 }
Ritor1
parents:
diff changeset
6559 while ( v7 < v5->uNumVertices );
Ritor1
parents:
diff changeset
6560 }
Ritor1
parents:
diff changeset
6561 }
Ritor1
parents:
diff changeset
6562 }
Ritor1
parents:
diff changeset
6563 v15 = v5->uNumVertices;
Ritor1
parents:
diff changeset
6564 a5a = 0;
Ritor1
parents:
diff changeset
6565 dword_4F5BF4_xs[v15 + 1] = dword_4F5BF4_xs[1];
Ritor1
parents:
diff changeset
6566 dword_4F5B24_ys[v15 + 1] = dword_4F5B24_ys[1];
Ritor1
parents:
diff changeset
6567 v25 = 0;
Ritor1
parents:
diff changeset
6568 v16 = dword_4F5B24_ys[1] >= a3;
Ritor1
parents:
diff changeset
6569 if ( v15 <= 0 )
Ritor1
parents:
diff changeset
6570 goto LABEL_29;
Ritor1
parents:
diff changeset
6571 do
Ritor1
parents:
diff changeset
6572 {
Ritor1
parents:
diff changeset
6573 if ( a5a >= 2 )
Ritor1
parents:
diff changeset
6574 break;
Ritor1
parents:
diff changeset
6575 v17 = v25;
Ritor1
parents:
diff changeset
6576 v18 = dword_4F5B24_ys[v25 + 2];
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1108
diff changeset
6577 if ( v16 ^ (v18 >= a3) )
0
Ritor1
parents:
diff changeset
6578 {
Ritor1
parents:
diff changeset
6579 v19 = dword_4F5BF4_xs[v17 + 2];
Ritor1
parents:
diff changeset
6580 if ( v19 >= a4a )
Ritor1
parents:
diff changeset
6581 v20 = 0;
Ritor1
parents:
diff changeset
6582 else
Ritor1
parents:
diff changeset
6583 v20 = 2;
1110
cf6cd674c398 bitwise operator ambiguity reduced
Grumpy7
parents: 1108
diff changeset
6584 v21 = v20 | (dword_4F5BF4_xs[v17 + 1] < a4a);
0
Ritor1
parents:
diff changeset
6585 if ( v21 != 3 )
Ritor1
parents:
diff changeset
6586 {
Ritor1
parents:
diff changeset
6587 if ( !v21
Ritor1
parents:
diff changeset
6588 || (v22 = v19 - dword_4F5BF4_xs[v17 + 1],
Ritor1
parents:
diff changeset
6589 LODWORD(v23) = v22 << 16,
Ritor1
parents:
diff changeset
6590 HIDWORD(v23) = v22 >> 16,
Ritor1
parents:
diff changeset
6591 dword_4F5BF4_xs[v17 + 1]
Ritor1
parents:
diff changeset
6592 + ((signed int)(((unsigned __int64)(v23
Ritor1
parents:
diff changeset
6593 / (v18 - dword_4F5B24_ys[v17 + 1])
Ritor1
parents:
diff changeset
6594 * ((a3 - dword_4F5B24_ys[v17 + 1]) << 16)) >> 16)
Ritor1
parents:
diff changeset
6595 + 32768) >> 16) >= a4a) )
Ritor1
parents:
diff changeset
6596 ++a5a;
Ritor1
parents:
diff changeset
6597 }
Ritor1
parents:
diff changeset
6598 }
Ritor1
parents:
diff changeset
6599 ++v25;
Ritor1
parents:
diff changeset
6600 v16 = v18 >= a3;
Ritor1
parents:
diff changeset
6601 }
Ritor1
parents:
diff changeset
6602 while ( v25 < v15 );
Ritor1
parents:
diff changeset
6603 result = 1;
Ritor1
parents:
diff changeset
6604 if ( a5a != 1 )
Ritor1
parents:
diff changeset
6605 LABEL_29:
Ritor1
parents:
diff changeset
6606 result = 0;
Ritor1
parents:
diff changeset
6607 return result;
Ritor1
parents:
diff changeset
6608 }
Ritor1
parents:
diff changeset
6609
Ritor1
parents:
diff changeset
6610 //----- (004088E9) --------------------------------------------------------
Ritor1
parents:
diff changeset
6611 signed int __fastcall sub_4088E9(int a1, int a2, int a3, int a4, int a5, int a6)
Ritor1
parents:
diff changeset
6612 {
Ritor1
parents:
diff changeset
6613 int v6; // esi@1
Ritor1
parents:
diff changeset
6614 int v7; // edi@1
Ritor1
parents:
diff changeset
6615 int v8; // eax@1
Ritor1
parents:
diff changeset
6616 signed int result; // eax@1
Ritor1
parents:
diff changeset
6617 int v10; // [sp+Ch] [bp-4h]@1
Ritor1
parents:
diff changeset
6618 int v11; // [sp+18h] [bp+8h]@1
Ritor1
parents:
diff changeset
6619
Ritor1
parents:
diff changeset
6620 v6 = a1;
Ritor1
parents:
diff changeset
6621 v10 = a2;
Ritor1
parents:
diff changeset
6622 v7 = a3 - a1;
Ritor1
parents:
diff changeset
6623 v11 = abs(a3 - a1);
Ritor1
parents:
diff changeset
6624 v8 = abs(a4 - v10);
295
640a176c030f sub_42ECB5
Nomad
parents: 275
diff changeset
6625 result = integer_sqrt(v11 * v11 + v8 * v8);
0
Ritor1
parents:
diff changeset
6626 if ( result )
Ritor1
parents:
diff changeset
6627 result = abs((v7 * (v10 - a6) - (a4 - v10) * (v6 - a5)) / result);
Ritor1
parents:
diff changeset
6628 return result;
Ritor1
parents:
diff changeset
6629 }
Ritor1
parents:
diff changeset
6630
Ritor1
parents:
diff changeset
6631 //----- (0040DEDB) --------------------------------------------------------
Ritor1
parents:
diff changeset
6632 unsigned int __stdcall R8G8B8_to_TargetFormat(int uColor)
Ritor1
parents:
diff changeset
6633 {
949
Nomad
parents: 948
diff changeset
6634 return TargetColor((unsigned __int8)uColor, BYTE1(uColor), BYTE2(uColor));
0
Ritor1
parents:
diff changeset
6635 }
Ritor1
parents:
diff changeset
6636
Ritor1
parents:
diff changeset
6637 //----- (0040DEF3) --------------------------------------------------------
949
Nomad
parents: 948
diff changeset
6638 unsigned short TargetColor( unsigned __int16 r, unsigned __int16 g, unsigned __int16 b )
983
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
6639 {
688
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
6640 return ((unsigned int)b >> (8 - LOBYTE(pRenderer->uTargetBBits))) | pRenderer->uTargetGMask & (g << (LOBYTE(pRenderer->uTargetGBits) +
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
6641 LOBYTE(pRenderer->uTargetBBits) - 8)) | pRenderer->uTargetRMask & (r << (LOBYTE(pRenderer->uTargetGBits) +
c0bfb386b15f some ui cleanup
Gloval
parents: 676
diff changeset
6642 LOBYTE(pRenderer->uTargetRBits) + LOBYTE(pRenderer->uTargetBBits) - 8));
0
Ritor1
parents:
diff changeset
6643 }
Ritor1
parents:
diff changeset
6644
Ritor1
parents:
diff changeset
6645 //----- (0040DFA7) --------------------------------------------------------
Ritor1
parents:
diff changeset
6646 int __stdcall retzero_sub_40DFA7(int a1)
Ritor1
parents:
diff changeset
6647 {
Ritor1
parents:
diff changeset
6648 return 0;
Ritor1
parents:
diff changeset
6649 }
Ritor1
parents:
diff changeset
6650 // 40DFA7: using guessed type int __stdcall retzero_sub_40DFA7(int);
Ritor1
parents:
diff changeset
6651
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
6652
0
Ritor1
parents:
diff changeset
6653
Ritor1
parents:
diff changeset
6654 //----- (0040F82D) --------------------------------------------------------
Ritor1
parents:
diff changeset
6655 void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue)
Ritor1
parents:
diff changeset
6656 {
973
ec7568e13b24 Minor code cleaning.
Nomad
parents: 972
diff changeset
6657 assert(uTextureId != -1);
ec7568e13b24 Minor code cleaning.
Nomad
parents: 972
diff changeset
6658 ZBuffer_DoFill(pZBuffer, pIcons_LOD->GetTexture(uTextureId), iZValue);
0
Ritor1
parents:
diff changeset
6659 }
Ritor1
parents:
diff changeset
6660
1160
502b8b2e36b4 font cleaning
Gloval
parents: 1118
diff changeset
6661
0
Ritor1
parents:
diff changeset
6662
Ritor1
parents:
diff changeset
6663 //----- (0040F89C) --------------------------------------------------------
Ritor1
parents:
diff changeset
6664 void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue)
Ritor1
parents:
diff changeset
6665 {
Ritor1
parents:
diff changeset
6666 void *v3; // eax@3
Ritor1
parents:
diff changeset
6667 void *v4; // esi@5
Ritor1
parents:
diff changeset
6668 int *v5; // edi@5
Ritor1
parents:
diff changeset
6669 int v6; // eax@5
Ritor1
parents:
diff changeset
6670 int v7; // ecx@6
Ritor1
parents:
diff changeset
6671 Texture *v8; // [sp+Ch] [bp-14h]@1
Ritor1
parents:
diff changeset
6672 int *v9; // [sp+10h] [bp-10h]@1
Ritor1
parents:
diff changeset
6673 int v10; // [sp+14h] [bp-Ch]@1
Ritor1
parents:
diff changeset
6674 int v11; // [sp+18h] [bp-8h]@1
Ritor1
parents:
diff changeset
6675 void *v12; // [sp+1Ch] [bp-4h]@5
Ritor1
parents:
diff changeset
6676
Ritor1
parents:
diff changeset
6677 v10 = pTex->uTextureWidth;
Ritor1
parents:
diff changeset
6678 v8 = pTex;
Ritor1
parents:
diff changeset
6679 v9 = pZBuffer;
Ritor1
parents:
diff changeset
6680 v11 = pTex->uTextureHeight;
Ritor1
parents:
diff changeset
6681 if ( pIcons_LOD->dword_011BA4 && pTex->uDecompressedSize )
Ritor1
parents:
diff changeset
6682 v3 = pTex->UnzipPalette();
Ritor1
parents:
diff changeset
6683 else
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
6684 v3 = pTex->pLevelOfDetail0_prolly_alpha_mask;
0
Ritor1
parents:
diff changeset
6685 v12 = v3;
Ritor1
parents:
diff changeset
6686 v4 = v3;
Ritor1
parents:
diff changeset
6687 v5 = v9;
Ritor1
parents:
diff changeset
6688 v6 = 0;
Ritor1
parents:
diff changeset
6689 do
Ritor1
parents:
diff changeset
6690 {
Ritor1
parents:
diff changeset
6691 v7 = v10;
Ritor1
parents:
diff changeset
6692 do
Ritor1
parents:
diff changeset
6693 {
Ritor1
parents:
diff changeset
6694 LOBYTE(v6) = *(char *)v4;
Ritor1
parents:
diff changeset
6695 v4 = (char *)v4 + 1;
Ritor1
parents:
diff changeset
6696 if ( v6 )
Ritor1
parents:
diff changeset
6697 *v5 = uZValue;
Ritor1
parents:
diff changeset
6698 ++v5;
Ritor1
parents:
diff changeset
6699 --v7;
Ritor1
parents:
diff changeset
6700 }
Ritor1
parents:
diff changeset
6701 while ( v7 );
Ritor1
parents:
diff changeset
6702 v5 += 640 - v10;
Ritor1
parents:
diff changeset
6703 --v11;
Ritor1
parents:
diff changeset
6704 }
Ritor1
parents:
diff changeset
6705 while ( v11 );
Ritor1
parents:
diff changeset
6706 if ( pIcons_LOD->dword_011BA4 )
Ritor1
parents:
diff changeset
6707 {
Ritor1
parents:
diff changeset
6708 if ( v8->uDecompressedSize )
Ritor1
parents:
diff changeset
6709 free(v12);
Ritor1
parents:
diff changeset
6710 }
Ritor1
parents:
diff changeset
6711 }
Ritor1
parents:
diff changeset
6712
Ritor1
parents:
diff changeset
6713 //----- (0040F92A) --------------------------------------------------------
Ritor1
parents:
diff changeset
6714 void __fastcall sub_40F92A(int *pZBuffer, Texture *a2, int a3)
Ritor1
parents:
diff changeset
6715 {
Ritor1
parents:
diff changeset
6716 Texture *v3; // esi@1
Ritor1
parents:
diff changeset
6717 void *v4; // eax@3
Ritor1
parents:
diff changeset
6718 int *v5; // edi@5
Ritor1
parents:
diff changeset
6719 int v6; // ecx@6
Ritor1
parents:
diff changeset
6720 int *v7; // [sp+Ch] [bp-10h]@1
Ritor1
parents:
diff changeset
6721 int v8; // [sp+10h] [bp-Ch]@1
Ritor1
parents:
diff changeset
6722 int v9; // [sp+18h] [bp-4h]@1
Ritor1
parents:
diff changeset
6723
Ritor1
parents:
diff changeset
6724 v3 = a2;
Ritor1
parents:
diff changeset
6725 v7 = pZBuffer;
Ritor1
parents:
diff changeset
6726 v8 = a2->uTextureWidth;
Ritor1
parents:
diff changeset
6727 v9 = a2->uTextureHeight;
Ritor1
parents:
diff changeset
6728 if ( pIcons_LOD->dword_011BA4 && a2->uDecompressedSize )
Ritor1
parents:
diff changeset
6729 v4 = a2->UnzipPalette();
Ritor1
parents:
diff changeset
6730 else
710
735dab8d3c9a Town portal screen + misc gui const replacements
Nomad
parents: 709
diff changeset
6731 v4 = a2->pLevelOfDetail0_prolly_alpha_mask;
0
Ritor1
parents:
diff changeset
6732 v5 = v7;
Ritor1
parents:
diff changeset
6733 do
Ritor1
parents:
diff changeset
6734 {
Ritor1
parents:
diff changeset
6735 v6 = v8;
Ritor1
parents:
diff changeset
6736 do
Ritor1
parents:
diff changeset
6737 {
Ritor1
parents:
diff changeset
6738 *v5 = a3;
Ritor1
parents:
diff changeset
6739 ++v5;
Ritor1
parents:
diff changeset
6740 --v6;
Ritor1
parents:
diff changeset
6741 }
Ritor1
parents:
diff changeset
6742 while ( v6 );
Ritor1
parents:
diff changeset
6743 v5 += 640 - v8;
Ritor1
parents:
diff changeset
6744 --v9;
Ritor1
parents:
diff changeset
6745 }
Ritor1
parents:
diff changeset
6746 while ( v9 );
Ritor1
parents:
diff changeset
6747 if ( pIcons_LOD->dword_011BA4 )
Ritor1
parents:
diff changeset
6748 {
Ritor1
parents:
diff changeset
6749 if ( v3->uDecompressedSize )
Ritor1
parents:
diff changeset
6750 free(v4);
Ritor1
parents:
diff changeset
6751 }
Ritor1
parents:
diff changeset
6752 }
Ritor1
parents:
diff changeset
6753
Ritor1
parents:
diff changeset
6754 //----- (00410D99) --------------------------------------------------------
Ritor1
parents:
diff changeset
6755 signed int __fastcall sub_410D99_get_map_index(int a1)
Ritor1
parents:
diff changeset
6756 {
Ritor1
parents:
diff changeset
6757 int v1; // edi@1
Ritor1
parents:
diff changeset
6758 signed int v2; // ebp@1
Ritor1
parents:
diff changeset
6759 const char **v3; // esi@2
Ritor1
parents:
diff changeset
6760 char *v4; // ebx@2
Ritor1
parents:
diff changeset
6761
Ritor1
parents:
diff changeset
6762 v1 = a1;
Ritor1
parents:
diff changeset
6763 v2 = 1;
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1101
diff changeset
6764 if ( _stricmp(pMapStats->pInfos[1].pFilename, (const char *)&pGames_LOD->pSubIndices[a1]) )
0
Ritor1
parents:
diff changeset
6765 {
Ritor1
parents:
diff changeset
6766 v3 = (const char **)&pMapStats->pInfos[1].pFilename;
Ritor1
parents:
diff changeset
6767 v4 = (char *)&pMapStats->pInfos[1].pFilename;
Ritor1
parents:
diff changeset
6768 do
Ritor1
parents:
diff changeset
6769 {
Ritor1
parents:
diff changeset
6770 if ( !*(int *)v4 )
Ritor1
parents:
diff changeset
6771 break;
Ritor1
parents:
diff changeset
6772 v3 += 17;
Ritor1
parents:
diff changeset
6773 ++v2;
Ritor1
parents:
diff changeset
6774 v4 = (char *)v3;
Ritor1
parents:
diff changeset
6775 }
1104
5d5c78088274 strcmpi to stricmp conversion
Grumpy7
parents: 1101
diff changeset
6776 while ( _stricmp(*v3, (const char *)&pGames_LOD->pSubIndices[v1]) );
0
Ritor1
parents:
diff changeset
6777 }
Ritor1
parents:
diff changeset
6778 return v2;
Ritor1
parents:
diff changeset
6779 }
Ritor1
parents:
diff changeset
6780
Ritor1
parents:
diff changeset
6781 // 4E28F8: using guessed type int pCurrentScreen;
Ritor1
parents:
diff changeset
6782
762
cf2fbac6edc9 Misc cleaning
Nomad
parents: 758
diff changeset
6783 void LoadFonts_and_DrawCopyrightWindow()
cf2fbac6edc9 Misc cleaning
Nomad
parents: 758
diff changeset
6784 {
cf2fbac6edc9 Misc cleaning
Nomad
parents: 758
diff changeset
6785 MainMenuUI_LoadFontsAndSomeStuff();
cf2fbac6edc9 Misc cleaning
Nomad
parents: 758
diff changeset
6786 DrawCopyrightWindow();
cf2fbac6edc9 Misc cleaning
Nomad
parents: 758
diff changeset
6787 }
0
Ritor1
parents:
diff changeset
6788
Ritor1
parents:
diff changeset
6789
Ritor1
parents:
diff changeset
6790 //----- (00416196) --------------------------------------------------------
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
6791 void identify_item()
0
Ritor1
parents:
diff changeset
6792 {
Ritor1
parents:
diff changeset
6793 Player *v0; // esi@2
Ritor1
parents:
diff changeset
6794 POINT *v1; // edi@2
Ritor1
parents:
diff changeset
6795 signed int v2; // ecx@5
Ritor1
parents:
diff changeset
6796 signed int v3; // eax@5
Ritor1
parents:
diff changeset
6797 int v4; // eax@5
Ritor1
parents:
diff changeset
6798 char v5; // sf@5
Ritor1
parents:
diff changeset
6799 int v6; // eax@5
Ritor1
parents:
diff changeset
6800 int v7; // eax@7
Ritor1
parents:
diff changeset
6801 unsigned __int16 v8; // ax@10
Ritor1
parents:
diff changeset
6802 int v9; // edi@10
Ritor1
parents:
diff changeset
6803 int v10; // eax@10
Ritor1
parents:
diff changeset
6804 int v11; // edx@13
Ritor1
parents:
diff changeset
6805 LONG v12; // edx@23
Ritor1
parents:
diff changeset
6806 signed int v13; // edx@23
Ritor1
parents:
diff changeset
6807 int v14; // edx@25
Ritor1
parents:
diff changeset
6808 unsigned int v15; // edi@25
Ritor1
parents:
diff changeset
6809 signed int v16; // edx@27
Ritor1
parents:
diff changeset
6810 int v17; // eax@54
Ritor1
parents:
diff changeset
6811 unsigned int v18; // edx@57
Ritor1
parents:
diff changeset
6812 int v19; // eax@65
Ritor1
parents:
diff changeset
6813 int v20; // edi@67
Ritor1
parents:
diff changeset
6814 int v21; // eax@72
Ritor1
parents:
diff changeset
6815 int v22; // ecx@74
Ritor1
parents:
diff changeset
6816 int v23; // edx@78
Ritor1
parents:
diff changeset
6817 int v24; // eax@79
Ritor1
parents:
diff changeset
6818 int v25; // eax@80
Ritor1
parents:
diff changeset
6819 int v26; // eax@84
Ritor1
parents:
diff changeset
6820 ItemGen *v27; // esi@98
Ritor1
parents:
diff changeset
6821 unsigned int v28; // eax@98
Ritor1
parents:
diff changeset
6822 ItemGen *v29; // edi@98
Ritor1
parents:
diff changeset
6823 unsigned int v30; // ecx@103
Ritor1
parents:
diff changeset
6824 double v31; // st7@112
Ritor1
parents:
diff changeset
6825 unsigned __int64 v32; // qax@113
Ritor1
parents:
diff changeset
6826 unsigned int v33; // ecx@117
Ritor1
parents:
diff changeset
6827 int v34; // eax@126
Ritor1
parents:
diff changeset
6828 unsigned int v35; // ecx@127
Ritor1
parents:
diff changeset
6829 double v36; // st7@132
Ritor1
parents:
diff changeset
6830 signed __int64 v37; // qax@135
Ritor1
parents:
diff changeset
6831 unsigned int v38; // eax@138
Ritor1
parents:
diff changeset
6832 Vec3_int_ v39; // [sp-18h] [bp-A8h]@83
Ritor1
parents:
diff changeset
6833 int *v40; // [sp-Ch] [bp-9Ch]@83
Ritor1
parents:
diff changeset
6834 int *v41; // [sp-8h] [bp-98h]@83
Ritor1
parents:
diff changeset
6835 int *v42; // [sp-4h] [bp-94h]@83
Ritor1
parents:
diff changeset
6836 GUIWindow v43; // [sp+Ch] [bp-84h]@137
Ritor1
parents:
diff changeset
6837 unsigned int pY; // [sp+60h] [bp-30h]@2
Ritor1
parents:
diff changeset
6838 int v45; // [sp+64h] [bp-2Ch]@10
Ritor1
parents:
diff changeset
6839 unsigned int pX; // [sp+68h] [bp-28h]@2
Ritor1
parents:
diff changeset
6840 int v47; // [sp+6Ch] [bp-24h]@25
Ritor1
parents:
diff changeset
6841 POINT y; // [sp+70h] [bp-20h]@2
Ritor1
parents:
diff changeset
6842 POINT a2; // [sp+78h] [bp-18h]@2
Ritor1
parents:
diff changeset
6843 Vec3_int_ pOut; // [sp+80h] [bp-10h]@2
Ritor1
parents:
diff changeset
6844 unsigned int v51; // [sp+8Ch] [bp-4h]@23
Ritor1
parents:
diff changeset
6845
Ritor1
parents:
diff changeset
6846 if ( dword_50CDCC )
Ritor1
parents:
diff changeset
6847 return;
Ritor1
parents:
diff changeset
6848 v0 = pPlayers[uActiveCharacter];
Ritor1
parents:
diff changeset
6849 v1 = pMouse->GetCursorPos(&a2);
Ritor1
parents:
diff changeset
6850 pOut.z = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&y)->y]] & 0xFFFF;
Ritor1
parents:
diff changeset
6851 pMouse->GetClickPos(&pX, &pY);
Ritor1
parents:
diff changeset
6852 if ( !pOut.z )
Ritor1
parents:
diff changeset
6853 {
Ritor1
parents:
diff changeset
6854 if ( (signed int)pX <= 13
Ritor1
parents:
diff changeset
6855 || (signed int)pX >= 462
Ritor1
parents:
diff changeset
6856 || (v2 = pX - 14,
Ritor1
parents:
diff changeset
6857 v3 = pY - 17,
Ritor1
parents:
diff changeset
6858 pX = v2,
Ritor1
parents:
diff changeset
6859 pY = v3,
Ritor1
parents:
diff changeset
6860 v4 = 14 * (v3 >> 5),
Ritor1
parents:
diff changeset
6861 v2 >>= 5,
Ritor1
parents:
diff changeset
6862 v5 = v2 + v4 < 0,
Ritor1
parents:
diff changeset
6863 v6 = v2 + v4,
Ritor1
parents:
diff changeset
6864 pOut.z = v6,
Ritor1
parents:
diff changeset
6865 v5)
Ritor1
parents:
diff changeset
6866 || v6 > 126
Ritor1
parents:
diff changeset
6867 || (v7 = v0->GetItemIDAtInventoryIndex(&pOut.z)) == 0 )
Ritor1
parents:
diff changeset
6868 return;
Ritor1
parents:
diff changeset
6869 pOut.z = v7;
Ritor1
parents:
diff changeset
6870 }
Ritor1
parents:
diff changeset
6871 if ( !v0->CanAct() )
Ritor1
parents:
diff changeset
6872 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
6873 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], v0->pName, pGlobalTXT_LocalizationStrings[541]);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
6874 v43.Hint = pTmpBuf.data();
0
Ritor1
parents:
diff changeset
6875 v43.uFrameWidth = 384;
Ritor1
parents:
diff changeset
6876 v43.uFrameHeight = 180;
Ritor1
parents:
diff changeset
6877 v43.uFrameY = 40;
Ritor1
parents:
diff changeset
6878 if ( pMouse->GetCursorPos(&a2)->x <= 320 )
Ritor1
parents:
diff changeset
6879 v38 = pMouse->GetCursorPos(&a2)->x + 30;
Ritor1
parents:
diff changeset
6880 else
Ritor1
parents:
diff changeset
6881 v38 = pMouse->GetCursorPos(&a2)->x - 414;
Ritor1
parents:
diff changeset
6882 v43.uFrameX = v38;
Ritor1
parents:
diff changeset
6883 v43.DrawMessageBox(0);
Ritor1
parents:
diff changeset
6884 return;
Ritor1
parents:
diff changeset
6885 }
Ritor1
parents:
diff changeset
6886 --pOut.z;
Ritor1
parents:
diff changeset
6887 LOBYTE(v8) = v0->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY);
Ritor1
parents:
diff changeset
6888 v9 = v8 & 0x3F;
Ritor1
parents:
diff changeset
6889 v45 = v8 & 0x3F;
Ritor1
parents:
diff changeset
6890 pOut.y = SkillToMastery(v8);
Ritor1
parents:
diff changeset
6891 v10 = pOut.z;
Ritor1
parents:
diff changeset
6892 if ( pParty->pPickedItem.uItemID == 220 )
Ritor1
parents:
diff changeset
6893 {
Ritor1
parents:
diff changeset
6894 LABEL_116:
Ritor1
parents:
diff changeset
6895 GameUI_DrawItemInfo(&v0->pInventoryItems[v10]);
Ritor1
parents:
diff changeset
6896 return;
Ritor1
parents:
diff changeset
6897 }
Ritor1
parents:
diff changeset
6898 if ( (signed int)pParty->pPickedItem.uItemID < 200
Ritor1
parents:
diff changeset
6899 || (signed int)pParty->pPickedItem.uItemID > 219
Ritor1
parents:
diff changeset
6900 || (v11 = (int)((char *)v0 + 36 * pOut.z), *(int *)(v11 + 532) != 220) )
Ritor1
parents:
diff changeset
6901 {
Ritor1
parents:
diff changeset
6902 if ( (signed int)pParty->pPickedItem.uItemID < 221
Ritor1
parents:
diff changeset
6903 || (signed int)pParty->pPickedItem.uItemID > 271
Ritor1
parents:
diff changeset
6904 || (v12 = (LONG)((char *)v0 + 36 * pOut.z), a2.y = v12, v13 = *(int *)(v12 + 532), v51 = v13, v13 < 221)
Ritor1
parents:
diff changeset
6905 || v13 > 271 )
Ritor1
parents:
diff changeset
6906 {
Ritor1
parents:
diff changeset
6907 if ( pParty->pPickedItem.uItemID != 236
Ritor1
parents:
diff changeset
6908 && ((signed int)pParty->pPickedItem.uItemID < 246 || (signed int)pParty->pPickedItem.uItemID > 250)
Ritor1
parents:
diff changeset
6909 && pParty->pPickedItem.uItemID != 263
Ritor1
parents:
diff changeset
6910 && pParty->pPickedItem.uItemID != 233 )
Ritor1
parents:
diff changeset
6911 goto LABEL_116;
Ritor1
parents:
diff changeset
6912 v27 = &v0->pInventoryItems[pOut.z];
Ritor1
parents:
diff changeset
6913 v28 = v27->uItemID;
Ritor1
parents:
diff changeset
6914 v51 = pItemsTable->pItems[v27->uItemID].uEquipType;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 563
diff changeset
6915 v29 = (ItemGen *)(1800 * pParty->pPickedItem.uEnchantmentType);
0
Ritor1
parents:
diff changeset
6916 if ( pParty->pPickedItem.uItemID != 233 )
Ritor1
parents:
diff changeset
6917 {
Ritor1
parents:
diff changeset
6918 if ( pParty->pPickedItem.uItemID == 236 )
Ritor1
parents:
diff changeset
6919 {
Ritor1
parents:
diff changeset
6920 v35 = v27->uAttributes;
Ritor1
parents:
diff changeset
6921 if ( v35 & 2 || (v51 & 0x80000000u) != 0 || (signed int)v51 > 12 || (signed int)v28 >= 500 )
Ritor1
parents:
diff changeset
6922 goto LABEL_92;
Ritor1
parents:
diff changeset
6923 LOWORD(v35) = v35 | 0x210;
Ritor1
parents:
diff changeset
6924 v27->uAttributes = v35;
Ritor1
parents:
diff changeset
6925 }
Ritor1
parents:
diff changeset
6926 else
Ritor1
parents:
diff changeset
6927 {
Ritor1
parents:
diff changeset
6928 if ( (signed int)pParty->pPickedItem.uItemID <= 245 )
Ritor1
parents:
diff changeset
6929 goto LABEL_92;
Ritor1
parents:
diff changeset
6930 if ( (signed int)pParty->pPickedItem.uItemID <= 250 )
Ritor1
parents:
diff changeset
6931 {
Ritor1
parents:
diff changeset
6932 v27->UpdateTempBonus(pParty->uTimePlayed);
Ritor1
parents:
diff changeset
6933 v33 = v27->uItemID;
Ritor1
parents:
diff changeset
6934 if ( (signed int)v27->uItemID >= 64 && (signed int)v33 <= 65
Ritor1
parents:
diff changeset
6935 || (pOut.y = v27->uAttributes, pOut.y & 2)
377
243418228760 GetIdentifiedName
Gloval
parents: 373
diff changeset
6936 || v27->uSpecEnchantmentType
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 563
diff changeset
6937 || v27->uEnchantmentType
0
Ritor1
parents:
diff changeset
6938 || v51 && v51 != 1 && v51 != 2
Ritor1
parents:
diff changeset
6939 || (signed int)v33 >= 500 )
Ritor1
parents:
diff changeset
6940 goto LABEL_92;
Ritor1
parents:
diff changeset
6941 v34 = *(int *)&aSbwb00[4 * pParty->pPickedItem.uItemID + 4];
Ritor1
parents:
diff changeset
6942 a2.y = (int)v29 << 7;
Ritor1
parents:
diff changeset
6943 v31 = (double)(signed int)((int)v29 << 7);
377
243418228760 GetIdentifiedName
Gloval
parents: 373
diff changeset
6944 v27->uSpecEnchantmentType = v34;
0
Ritor1
parents:
diff changeset
6945 }
Ritor1
parents:
diff changeset
6946 else
Ritor1
parents:
diff changeset
6947 {
Ritor1
parents:
diff changeset
6948 if ( pParty->pPickedItem.uItemID != 263
Ritor1
parents:
diff changeset
6949 || (v27->UpdateTempBonus(pParty->uTimePlayed), v30 = v27->uItemID, (signed int)v27->uItemID >= 64)
Ritor1
parents:
diff changeset
6950 && (signed int)v30 <= 65
Ritor1
parents:
diff changeset
6951 || (pOut.y = v27->uAttributes, pOut.y & 2)
377
243418228760 GetIdentifiedName
Gloval
parents: 373
diff changeset
6952 || v27->uSpecEnchantmentType
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 563
diff changeset
6953 || v27->uEnchantmentType
0
Ritor1
parents:
diff changeset
6954 || v51 && v51 != 1 && v51 != 2
Ritor1
parents:
diff changeset
6955 || (signed int)v30 >= 500 )
Ritor1
parents:
diff changeset
6956 goto LABEL_92;
Ritor1
parents:
diff changeset
6957 a2.y = (int)v29 << 7;
377
243418228760 GetIdentifiedName
Gloval
parents: 373
diff changeset
6958 v27->uSpecEnchantmentType = 40;
0
Ritor1
parents:
diff changeset
6959 v31 = (double)a2.y;
Ritor1
parents:
diff changeset
6960 }
Ritor1
parents:
diff changeset
6961 v32 = pParty->uTimePlayed + (signed int)(signed __int64)(v31 * 0.033333335);
Ritor1
parents:
diff changeset
6962 LODWORD(v27->uExpireTime) = v32;
Ritor1
parents:
diff changeset
6963 LODWORD(v32) = pOut.y;
Ritor1
parents:
diff changeset
6964 LOBYTE(v32) = LOBYTE(pOut.y) | 0x18;
Ritor1
parents:
diff changeset
6965 HIDWORD(v27->uExpireTime) = HIDWORD(v32);
Ritor1
parents:
diff changeset
6966 v27->uAttributes = v32;
Ritor1
parents:
diff changeset
6967 }
984
d982fffb8b96 CharacterUI_InventoryTab_Draw cleaned.
Nomad
parents: 983
diff changeset
6968 _50C9A8_item_enchantment_timer = 256;
0
Ritor1
parents:
diff changeset
6969 goto LABEL_92;
Ritor1
parents:
diff changeset
6970 }
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 563
diff changeset
6971 v36 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01;
0
Ritor1
parents:
diff changeset
6972 if ( v36 < 0.0 )
Ritor1
parents:
diff changeset
6973 v36 = 0.0;
Ritor1
parents:
diff changeset
6974 if ( v51 != 12 )
Ritor1
parents:
diff changeset
6975 {
Ritor1
parents:
diff changeset
6976 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
Ritor1
parents:
diff changeset
6977 return;
Ritor1
parents:
diff changeset
6978 }
Ritor1
parents:
diff changeset
6979 a2.y = v27->uMaxCharges;
Ritor1
parents:
diff changeset
6980 v37 = (signed __int64)((double)a2.y - v36 * (double)a2.y);
Ritor1
parents:
diff changeset
6981 v27->uMaxCharges = v37;
Ritor1
parents:
diff changeset
6982 v27->uNumCharges = (unsigned __int8)v37;
Ritor1
parents:
diff changeset
6983 goto LABEL_92;
Ritor1
parents:
diff changeset
6984 }
Ritor1
parents:
diff changeset
6985 v14 = v13 - 222;
Ritor1
parents:
diff changeset
6986 v15 = pParty->pPickedItem.uItemID - 222;
Ritor1
parents:
diff changeset
6987 v47 = v14;
Ritor1
parents:
diff changeset
6988 y.y = 0;
Ritor1
parents:
diff changeset
6989 if ( pParty->pPickedItem.uItemID == 221 || v51 == 221 )
Ritor1
parents:
diff changeset
6990 {
Ritor1
parents:
diff changeset
6991 v16 = 5;
Ritor1
parents:
diff changeset
6992 }
Ritor1
parents:
diff changeset
6993 else
Ritor1
parents:
diff changeset
6994 {
Ritor1
parents:
diff changeset
6995 v16 = *(short *)&pItemsTable->field_EDE0[2 * (v14 + 50 * v15) + 388];
Ritor1
parents:
diff changeset
6996 v10 = pOut.z;
Ritor1
parents:
diff changeset
6997 }
Ritor1
parents:
diff changeset
6998 v51 = v16;
Ritor1
parents:
diff changeset
6999 if ( v45 )
Ritor1
parents:
diff changeset
7000 {
Ritor1
parents:
diff changeset
7001 if ( v16 < 225 || v16 > 227 )
Ritor1
parents:
diff changeset
7002 {
Ritor1
parents:
diff changeset
7003 if ( v16 < 228 || v16 > 239 )
Ritor1
parents:
diff changeset
7004 {
Ritor1
parents:
diff changeset
7005 if ( v16 < 240 || v16 > 261 )
Ritor1
parents:
diff changeset
7006 {
Ritor1
parents:
diff changeset
7007 if ( v16 >= 262 && pOut.y != 4 )
Ritor1
parents:
diff changeset
7008 {
Ritor1
parents:
diff changeset
7009 LABEL_53:
Ritor1
parents:
diff changeset
7010 v51 = 4;
Ritor1
parents:
diff changeset
7011 goto LABEL_54;
Ritor1
parents:
diff changeset
7012 }
Ritor1
parents:
diff changeset
7013 }
Ritor1
parents:
diff changeset
7014 else
Ritor1
parents:
diff changeset
7015 {
Ritor1
parents:
diff changeset
7016 if ( pOut.y <= 2 )
Ritor1
parents:
diff changeset
7017 {
Ritor1
parents:
diff changeset
7018 LABEL_38:
Ritor1
parents:
diff changeset
7019 v51 = 3;
Ritor1
parents:
diff changeset
7020 goto LABEL_54;
Ritor1
parents:
diff changeset
7021 }
Ritor1
parents:
diff changeset
7022 }
Ritor1
parents:
diff changeset
7023 }
Ritor1
parents:
diff changeset
7024 else
Ritor1
parents:
diff changeset
7025 {
Ritor1
parents:
diff changeset
7026 if ( pOut.y == 1 )
Ritor1
parents:
diff changeset
7027 {
Ritor1
parents:
diff changeset
7028 LABEL_35:
Ritor1
parents:
diff changeset
7029 v51 = 2;
Ritor1
parents:
diff changeset
7030 goto LABEL_54;
Ritor1
parents:
diff changeset
7031 }
Ritor1
parents:
diff changeset
7032 }
Ritor1
parents:
diff changeset
7033 }
Ritor1
parents:
diff changeset
7034 }
Ritor1
parents:
diff changeset
7035 else
Ritor1
parents:
diff changeset
7036 {
Ritor1
parents:
diff changeset
7037 if ( v16 >= 225 && v16 <= 227 )
Ritor1
parents:
diff changeset
7038 {
Ritor1
parents:
diff changeset
7039 v51 = 1;
Ritor1
parents:
diff changeset
7040 goto LABEL_54;
Ritor1
parents:
diff changeset
7041 }
Ritor1
parents:
diff changeset
7042 if ( v16 >= 228 && v16 <= 239 )
Ritor1
parents:
diff changeset
7043 goto LABEL_35;
Ritor1
parents:
diff changeset
7044 if ( v16 >= 240 && v16 <= 261 )
Ritor1
parents:
diff changeset
7045 goto LABEL_38;
Ritor1
parents:
diff changeset
7046 if ( v16 >= 262 )
Ritor1
parents:
diff changeset
7047 goto LABEL_53;
Ritor1
parents:
diff changeset
7048 }
Ritor1
parents:
diff changeset
7049 LABEL_54:
Ritor1
parents:
diff changeset
7050 pOut.y = 0;
Ritor1
parents:
diff changeset
7051 pOut.x = v10 + 1;
Ritor1
parents:
diff changeset
7052 v17 = (int)v0->pInventoryIndices;
Ritor1
parents:
diff changeset
7053 while ( *(int *)v17 != pOut.x )
Ritor1
parents:
diff changeset
7054 {
Ritor1
parents:
diff changeset
7055 ++pOut.y;
Ritor1
parents:
diff changeset
7056 v17 += 4;
Ritor1
parents:
diff changeset
7057 if ( pOut.y >= 126 )
Ritor1
parents:
diff changeset
7058 {
Ritor1
parents:
diff changeset
7059 v18 = y.y;
Ritor1
parents:
diff changeset
7060 goto LABEL_59;
Ritor1
parents:
diff changeset
7061 }
Ritor1
parents:
diff changeset
7062 }
Ritor1
parents:
diff changeset
7063 v18 = pOut.y;
Ritor1
parents:
diff changeset
7064 LABEL_59:
Ritor1
parents:
diff changeset
7065 if ( !v51 )
Ritor1
parents:
diff changeset
7066 {
Ritor1
parents:
diff changeset
7067 LABEL_115:
Ritor1
parents:
diff changeset
7068 v10 = pOut.z;
Ritor1
parents:
diff changeset
7069 goto LABEL_116;
Ritor1
parents:
diff changeset
7070 }
Ritor1
parents:
diff changeset
7071 if ( v51 == 1 )
Ritor1
parents:
diff changeset
7072 {
Ritor1
parents:
diff changeset
7073 v0->RemoveItemAtInventoryIndex(v18);
Ritor1
parents:
diff changeset
7074 v26 = rand();
1036
7f8be9f9769e player recieve damage
Gloval
parents: 1033
diff changeset
7075 v0->ReceiveDamage(v26 % 11 + 10, DMGT_FIRE);
0
Ritor1
parents:
diff changeset
7076 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
7077
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
7078 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
7079
0
Ritor1
parents:
diff changeset
7080 v42 = (int *)&a2.y;
Ritor1
parents:
diff changeset
7081 v41 = (int *)&y.y;
Ritor1
parents:
diff changeset
7082 v40 = (int *)&pOut;
Ritor1
parents:
diff changeset
7083 v39.z = pParty->vPosition.z + pParty->sEyelevel;
Ritor1
parents:
diff changeset
7084 }
Ritor1
parents:
diff changeset
7085 else
Ritor1
parents:
diff changeset
7086 {
Ritor1
parents:
diff changeset
7087 if ( v51 == 2 )
Ritor1
parents:
diff changeset
7088 {
Ritor1
parents:
diff changeset
7089 v0->RemoveItemAtInventoryIndex(v18);
Ritor1
parents:
diff changeset
7090 v25 = rand();
1036
7f8be9f9769e player recieve damage
Gloval
parents: 1033
diff changeset
7091 v0->ReceiveDamage(v25 % 71 + 30, DMGT_FIRE);
0
Ritor1
parents:
diff changeset
7092 v23 = 1;
Ritor1
parents:
diff changeset
7093 }
Ritor1
parents:
diff changeset
7094 else
Ritor1
parents:
diff changeset
7095 {
Ritor1
parents:
diff changeset
7096 if ( v51 == 3 )
Ritor1
parents:
diff changeset
7097 {
Ritor1
parents:
diff changeset
7098 v0->RemoveItemAtInventoryIndex(v18);
Ritor1
parents:
diff changeset
7099 v24 = rand();
1036
7f8be9f9769e player recieve damage
Gloval
parents: 1033
diff changeset
7100 v0->ReceiveDamage(v24 % 201 + 50, DMGT_FIRE);
0
Ritor1
parents:
diff changeset
7101 v23 = 5;
Ritor1
parents:
diff changeset
7102 }
Ritor1
parents:
diff changeset
7103 else
Ritor1
parents:
diff changeset
7104 {
Ritor1
parents:
diff changeset
7105 if ( v51 != 4 )
Ritor1
parents:
diff changeset
7106 {
Ritor1
parents:
diff changeset
7107 if ( v51 != 5 )
Ritor1
parents:
diff changeset
7108 {
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
7109 v19 = v0->AddItem(-1, 0xDCu);
0
Ritor1
parents:
diff changeset
7110 if ( v19 )
1019
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
7111 // *(int *)&v0->field_1F5[36 * v19 + 15] = 1;
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
7112 v0->pOwnItems[v19-1].uAttributes=ITEM_IDENTIFIED;
0
Ritor1
parents:
diff changeset
7113 v20 = v47 + 50 * v15;
Ritor1
parents:
diff changeset
7114 v0->pInventoryItems[pOut.z].uItemID = v51;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 563
diff changeset
7115 v0->pInventoryItems[pOut.z].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType
f54481c85df8 itemgen working, i hope
Gloval
parents: 563
diff changeset
7116 + v0->pInventoryItems[pOut.z].uEnchantmentType)
0
Ritor1
parents:
diff changeset
7117 / 2;
222
8113753ed2ae more item init fixing
Gloval
parents: 191
diff changeset
7118 v0->SetVariable(VAR_AutoNotes, *(short *)&pItemsTable->potion_note[2 * v20 ]);//field_10168 + 388
0
Ritor1
parents:
diff changeset
7119 LABEL_74:
Ritor1
parents:
diff changeset
7120 v22 = (int)((char *)v0 + 36 * pOut.z);
222
8113753ed2ae more item init fixing
Gloval
parents: 191
diff changeset
7121 if ( !(pItemsTable->pItems[*(int *)(v22 + 532) ].uItemID_Rep_St) )
0
Ritor1
parents:
diff changeset
7122 *(int *)(v22 + 552) |= 1u;
Ritor1
parents:
diff changeset
7123 if ( !dword_4E455C )
Ritor1
parents:
diff changeset
7124 goto LABEL_92;
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
7125 v0->PlaySound(SPEECH_16, 0);
0
Ritor1
parents:
diff changeset
7126 goto LABEL_91;
Ritor1
parents:
diff changeset
7127 }
Ritor1
parents:
diff changeset
7128 if ( v45 )
Ritor1
parents:
diff changeset
7129 {
Ritor1
parents:
diff changeset
7130 if ( *(int *)(a2.y + 532) == 221 )
Ritor1
parents:
diff changeset
7131 *(int *)(a2.y + 532) = pParty->pPickedItem.uItemID;
Ritor1
parents:
diff changeset
7132 else
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 563
diff changeset
7133 *(int *)(a2.y + 536) = pParty->pPickedItem.uEnchantmentType;
1014
a704435d3285 comtinue player cleaning
Gloval
parents: 1012
diff changeset
7134 v21 = v0->AddItem(-1, 0xDCu);
0
Ritor1
parents:
diff changeset
7135 if ( v21 )
1019
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
7136 //*(int *)&v0->field_1F5[36 * v21 + 15] = 1;
32ec62bbaa2c player use item part cleanup
Gloval
parents: 1014
diff changeset
7137 v0->pOwnItems[v21-1].uAttributes=ITEM_IDENTIFIED;
0
Ritor1
parents:
diff changeset
7138 goto LABEL_74;
Ritor1
parents:
diff changeset
7139 }
Ritor1
parents:
diff changeset
7140 goto LABEL_115;
Ritor1
parents:
diff changeset
7141 }
Ritor1
parents:
diff changeset
7142 v0->RemoveItemAtInventoryIndex(v18);
Ritor1
parents:
diff changeset
7143 v0->SetCondition(0x10u, 0);
Ritor1
parents:
diff changeset
7144 v23 = 0;
Ritor1
parents:
diff changeset
7145 }
Ritor1
parents:
diff changeset
7146 }
1012
9e823ad5eaa6 second msg_queue returned
Gloval
parents: 1006
diff changeset
7147 v0->ItemsEnchant(v23);
0
Ritor1
parents:
diff changeset
7148 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
437
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
7149
0a1ea44b4a0a ui mesages & spellcasting
Nomad
parents: 434
diff changeset
7150 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1031
diff changeset
7151
0
Ritor1
parents:
diff changeset
7152 v42 = (int *)&a2.y;
Ritor1
parents:
diff changeset
7153 v41 = (int *)&y.y;
Ritor1
parents:
diff changeset
7154 v40 = (int *)&pOut;
Ritor1
parents:
diff changeset
7155 v39.z = pParty->vPosition.z + pParty->sEyelevel;
Ritor1
parents:
diff changeset
7156 }
Ritor1
parents:
diff changeset
7157 *(_QWORD *)&v39.x = *(_QWORD *)&pParty->vPosition.x;
Ritor1
parents:
diff changeset
7158 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, v40, v41, v42);
Ritor1
parents:
diff changeset
7159 sub_42F7EB_DropItemAt(0x41Bu, pOut.x, y.y, a2.y, 0, 1, 0, 0, 0);
Ritor1
parents:
diff changeset
7160 if ( dword_4E455C )
Ritor1
parents:
diff changeset
7161 {
Ritor1
parents:
diff changeset
7162 if ( v0->CanAct() )
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
7163 v0->PlaySound(SPEECH_17, 0);
0
Ritor1
parents:
diff changeset
7164 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2u);
Ritor1
parents:
diff changeset
7165 LABEL_91:
Ritor1
parents:
diff changeset
7166 dword_4E455C = 0;
Ritor1
parents:
diff changeset
7167 }
Ritor1
parents:
diff changeset
7168 LABEL_92:
Ritor1
parents:
diff changeset
7169 pMouse->RemoveHoldingItem();
Ritor1
parents:
diff changeset
7170 dword_50CDCC = 1;
Ritor1
parents:
diff changeset
7171 return;
Ritor1
parents:
diff changeset
7172 }
Ritor1
parents:
diff changeset
7173 *(int *)(v11 + 536) = v9 + pItemsTable->pItems[pParty->pPickedItem.uItemID].uDamageDice;
Ritor1
parents:
diff changeset
7174 switch ( pParty->pPickedItem.uItemID )
Ritor1
parents:
diff changeset
7175 {
Ritor1
parents:
diff changeset
7176 case 0xC8u:
Ritor1
parents:
diff changeset
7177 case 0xC9u:
Ritor1
parents:
diff changeset
7178 case 0xCAu:
Ritor1
parents:
diff changeset
7179 case 0xCBu:
Ritor1
parents:
diff changeset
7180 case 0xCCu:
Ritor1
parents:
diff changeset
7181 v0->pInventoryItems[pOut.z].uItemID = 222;
Ritor1
parents:
diff changeset
7182 break;
Ritor1
parents:
diff changeset
7183 case 0xCDu:
Ritor1
parents:
diff changeset
7184 case 0xCEu:
Ritor1
parents:
diff changeset
7185 case 0xCFu:
Ritor1
parents:
diff changeset
7186 case 0xD0u:
Ritor1
parents:
diff changeset
7187 case 0xD1u:
Ritor1
parents:
diff changeset
7188 v0->pInventoryItems[pOut.z].uItemID = 223;
Ritor1
parents:
diff changeset
7189 break;
Ritor1
parents:
diff changeset
7190 case 0xD2u:
Ritor1
parents:
diff changeset
7191 case 0xD3u:
Ritor1
parents:
diff changeset
7192 case 0xD4u:
Ritor1
parents:
diff changeset
7193 case 0xD5u:
Ritor1
parents:
diff changeset
7194 case 0xD6u:
Ritor1
parents:
diff changeset
7195 v0->pInventoryItems[pOut.z].uItemID = 224;
Ritor1
parents:
diff changeset
7196 break;
Ritor1
parents:
diff changeset
7197 case 0xD7u:
Ritor1
parents:
diff changeset
7198 case 0xD8u:
Ritor1
parents:
diff changeset
7199 case 0xD9u:
Ritor1
parents:
diff changeset
7200 case 0xDAu:
Ritor1
parents:
diff changeset
7201 case 0xDBu:
Ritor1
parents:
diff changeset
7202 v0->pInventoryItems[pOut.z].uItemID = 221;
Ritor1
parents:
diff changeset
7203 break;
Ritor1
parents:
diff changeset
7204 default:
Ritor1
parents:
diff changeset
7205 break;
Ritor1
parents:
diff changeset
7206 }
Ritor1
parents:
diff changeset
7207 pMouse->RemoveHoldingItem();
Ritor1
parents:
diff changeset
7208 dword_50CDCC = 1;
Ritor1
parents:
diff changeset
7209 if ( dword_4E455C )
Ritor1
parents:
diff changeset
7210 {
187
49728858c35e On player voices
Nomad
parents: 165
diff changeset
7211 v0->PlaySound(SPEECH_16, 0);
0
Ritor1
parents:
diff changeset
7212 dword_4E455C = 0;
Ritor1
parents:
diff changeset
7213 }
Ritor1
parents:
diff changeset
7214 }
Ritor1
parents:
diff changeset
7215
Ritor1
parents:
diff changeset
7216 //----- (004179BC) --------------------------------------------------------
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
7217 void __fastcall sub_4179BC_draw_tooltip( const char *a1, const char *a2 )
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
7218 {
0
Ritor1
parents:
diff changeset
7219 const char *v2; // ebx@1
Ritor1
parents:
diff changeset
7220 const char *v3; // edi@1
Ritor1
parents:
diff changeset
7221 unsigned int v4; // eax@1
Ritor1
parents:
diff changeset
7222 GUIWindow Dst; // [sp+Ch] [bp-5Ch]@1
Ritor1
parents:
diff changeset
7223 POINT v6; // [sp+60h] [bp-8h]@1
Ritor1
parents:
diff changeset
7224
Ritor1
parents:
diff changeset
7225 v2 = a2;
Ritor1
parents:
diff changeset
7226 v3 = a1;
Ritor1
parents:
diff changeset
7227 memset(&Dst, 0, 0x54u);
Ritor1
parents:
diff changeset
7228 Dst.uFrameWidth = 384;
Ritor1
parents:
diff changeset
7229 Dst.uFrameHeight = 256;
Ritor1
parents:
diff changeset
7230 Dst.uFrameX = 128;
Ritor1
parents:
diff changeset
7231 Dst.uFrameY = pMouse->GetCursorPos(&v6)->y + 30;
Ritor1
parents:
diff changeset
7232 Dst.uFrameHeight = pFontSmallnum->CalcTextHeight(v2, &Dst, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24;
Ritor1
parents:
diff changeset
7233 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
Ritor1
parents:
diff changeset
7234 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
Ritor1
parents:
diff changeset
7235 Dst.DrawMessageBox(0);
Ritor1
parents:
diff changeset
7236 Dst.uFrameX += 12;
Ritor1
parents:
diff changeset
7237 Dst.uFrameWidth -= 24;
Ritor1
parents:
diff changeset
7238 Dst.uFrameY += 12;
Ritor1
parents:
diff changeset
7239 Dst.uFrameHeight -= 12;
Ritor1
parents:
diff changeset
7240 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1;
Ritor1
parents:
diff changeset
7241 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1;
949
Nomad
parents: 948
diff changeset
7242 v4 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
7243 sprintf(pTmpBuf.data(), format_4E2D80, v4, v3);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
7244 Dst.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3u);
1006
e865f349aa41 ui cleanup
Gloval
parents: 1004
diff changeset
7245 Dst.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, v2, 0, 0, 0);
0
Ritor1
parents:
diff changeset
7246 }
Ritor1
parents:
diff changeset
7247
Ritor1
parents:
diff changeset
7248 //----- (00417AD4) --------------------------------------------------------
983
1462a5f12b65 Character Skills tab drawing fixed.
Nomad
parents: 982
diff changeset
7249 unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level)
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7250 {
0
Ritor1
parents:
diff changeset
7251 int v8; // eax@10
Ritor1
parents:
diff changeset
7252 int v12; // eax@14
Ritor1
parents:
diff changeset
7253 unsigned int yellow; // [sp+Ch] [bp-Ch]@1
Ritor1
parents:
diff changeset
7254 unsigned int red; // [sp+10h] [bp-8h]@1
Ritor1
parents:
diff changeset
7255 unsigned int white; // [sp+14h] [bp-4h]@1
Ritor1
parents:
diff changeset
7256
949
Nomad
parents: 948
diff changeset
7257 white = TargetColor(0xFFu, 0xFFu, 0xFFu);
Nomad
parents: 948
diff changeset
7258 red = TargetColor(0xFFu, 0, 0);
Nomad
parents: 948
diff changeset
7259 yellow = TargetColor(0xFFu, 0xFFu, 0);
269
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7260 if ( !(uPlayerClass % 4) )
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7261 {
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7262 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
269
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7263 return white;
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7264 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7265 && byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType] < skill_level )
269
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7266 {
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7267 v12 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 3][uPlayerSkillType];
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7268 if ( v12 < skill_level )
269
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7269 return red;
0
Ritor1
parents:
diff changeset
7270 }
Ritor1
parents:
diff changeset
7271 return yellow;
Ritor1
parents:
diff changeset
7272 }
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7273 if ( (uPlayerClass % 4) == 1 )
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7274 {
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7275 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] >= skill_level )
269
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7276 return white;
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7277 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 1][uPlayerSkillType] < skill_level )
269
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7278 {
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7279 v8 = byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass + 2][uPlayerSkillType];
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7280 if ( v8 < skill_level)
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7281 return red;
0
Ritor1
parents:
diff changeset
7282 }
Ritor1
parents:
diff changeset
7283 return yellow;
Ritor1
parents:
diff changeset
7284 }
273
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7285 if ( (uPlayerClass % 4) == 2 || (uPlayerClass % 4) == 3 )
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7286 {
e5afd6848268 GetSkillColor
Ritor1
parents: 269
diff changeset
7287 if ( byte_4ED970_skill_learn_ability_by_class_table[uPlayerClass][uPlayerSkillType] < skill_level )
0
Ritor1
parents:
diff changeset
7288 return red;
269
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7289 }
b34b53ee874d skill_learn_ability_by_class_table[36][37]
Ritor1
parents: 264
diff changeset
7290 return white;
1296
c423f946dc99 moving files continue
Ritor1
parents: 1273
diff changeset
7291 }