Mercurial > mm7
annotate mm7_6.cpp @ 1972:3ef25d06b9b0
Actor::special_ability_use_check moved to Actor and cleaned up
author | Grumpy7 |
---|---|
date | Sat, 26 Oct 2013 00:18:52 -0700 |
parents | e45c277da9f1 |
children | f708aaeb635b |
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 |
0 | 5 #include "MM7.h" |
6 | |
1016 | 7 |
8 | |
1323 | 9 #include "Weather.h" |
1016 | 10 #include "Sprites.h" |
11 #include "BSPModel.h" | |
12 #include "Mouse.h" | |
13 #include "Keyboard.h" | |
14 #include "stru6.h" | |
15 | |
16 #include "Vis.h" | |
0 | 17 #include "Game.h" |
18 #include "GUIWindow.h" | |
19 #include "GUIFont.h" | |
20 #include "Party.h" | |
21 #include "AudioPlayer.h" | |
22 #include "Outdoor.h" | |
1277 | 23 #include "Outdoor_stuff.h" |
0 | 24 #include "Overlays.h" |
25 #include "LOD.h" | |
26 #include "Actor.h" | |
27 #include "Events.h" | |
28 #include "Viewport.h" | |
29 #include "Math.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
30 #include "SpriteObject.h" |
0 | 31 #include "ObjectList.h" |
32 #include "stru123.h" | |
33 #include "Time.h" | |
34 #include "IconFrameTable.h" | |
35 #include "Awards.h" | |
36 #include "TurnEngine.h" | |
924 | 37 #include "CastSpellInfo.h" |
0 | 38 #include "stru298.h" |
189 | 39 #include "texts.h" |
0 | 40 |
41 #include "mm7_data.h" | |
42 | |
43 | |
44 | |
45 | |
46 | |
47 //----- (004272F5) -------------------------------------------------------- | |
48 int stru319::PlayerHitOrMiss(Player *pPlayer, Actor *pActor, int a3, int a4) | |
49 { | |
50 signed int v5; // esi@1 | |
51 signed int v6; // edi@1 | |
52 int v7; // esi@8 | |
53 int v8; // eax@9 | |
54 int v9; // edx@11 | |
55 int v10; // edx@13 | |
56 int v11; // esi@13 | |
57 unsigned __int8 v12; // sf@13 | |
58 unsigned __int8 v13; // of@13 | |
59 int v14; // edx@14 | |
60 int v15; // eax@14 | |
61 signed int result; // eax@17 | |
62 | |
63 v5 = pActor->pMonsterInfo.uAC; | |
64 v6 = 0; | |
1952
4ed7d18abe93
pActorBuffs[8] to pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC]
Grumpy7
parents:
1936
diff
changeset
|
65 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime > 0 ) |
0 | 66 v5 /= 2; |
1958
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
67 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) |
1959 | 68 v6 = pActor->pActorBuffs[ACTOR_BUFF_SHIELD].uPower; |
1960
f92fc67d66cb
pActorBuffs[16] to pActorBuffs[ACTOR_BUFF_STONESKIN]
Grumpy7
parents:
1959
diff
changeset
|
69 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v6 ) |
f92fc67d66cb
pActorBuffs[16] to pActorBuffs[ACTOR_BUFF_STONESKIN]
Grumpy7
parents:
1959
diff
changeset
|
70 v6 = pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower; |
0 | 71 v7 = v6 + v5; |
72 if ( a3 ) | |
73 v8 = pPlayer->GetRangedAttack(); | |
74 else | |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1637
diff
changeset
|
75 v8 = pPlayer->GetActualAttack(false); |
0 | 76 v9 = rand() % (v7 + 2 * v8 + 30); |
77 if ( a3 == 2 ) | |
78 { | |
79 v14 = a4 + v9; | |
80 v15 = ((v7 + 15) >> 1) + v7 + 15; | |
1419 | 81 v13 = __OFSUB__(v14, v15); |
82 v12 = v14 - v15 < 0; | |
0 | 83 } |
84 else | |
85 { | |
86 if ( a3 != 3 ) | |
87 { | |
88 v10 = a4 + v9; | |
89 v11 = v7 + 15; | |
90 v13 = __OFSUB__(v10, v11); | |
91 v12 = v10 - v11 < 0; | |
92 } | |
1419 | 93 else |
94 { | |
95 v14 = a4 + v9; | |
96 v15 = 2 * v7 + 30; | |
97 v13 = __OFSUB__(v14, v15); | |
98 v12 = v14 - v15 < 0; | |
99 } | |
0 | 100 } |
101 if ( v12 ^ v13 ) | |
102 result = 0; | |
103 else | |
104 result = 1; | |
105 return result; | |
106 } | |
107 | |
108 //----- (004273BB) -------------------------------------------------------- | |
109 bool stru319::_4273BB(Actor *pActor, Actor *a2, int a3, int a4) | |
110 { | |
111 Actor *v5; // ecx@1 | |
112 signed int v6; // ebx@1 | |
113 signed int v7; // esi@1 | |
114 unsigned __int8 v8; // zf@1 | |
115 unsigned __int8 v9; // sf@1 | |
116 int v10; // ebx@10 | |
117 signed int a2a; // [sp+18h] [bp+Ch]@1 | |
118 | |
119 v5 = a2; | |
120 v6 = a2->pMonsterInfo.uAC; | |
121 v7 = 0; | |
1952
4ed7d18abe93
pActorBuffs[8] to pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC]
Grumpy7
parents:
1936
diff
changeset
|
122 v8 = HIDWORD(a2->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime) == 0; |
4ed7d18abe93
pActorBuffs[8] to pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC]
Grumpy7
parents:
1936
diff
changeset
|
123 v9 = SHIDWORD(a2->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime) < 0; |
0 | 124 a2a = 0; |
1952
4ed7d18abe93
pActorBuffs[8] to pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC]
Grumpy7
parents:
1936
diff
changeset
|
125 if ( !v9 && (!(v9 | v8) || LODWORD(v5->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime) > 0) ) |
0 | 126 v6 /= 2; |
1958
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
127 if ( (signed __int64)v5->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) |
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
128 v7 = v5->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; |
1960
f92fc67d66cb
pActorBuffs[16] to pActorBuffs[ACTOR_BUFF_STONESKIN]
Grumpy7
parents:
1959
diff
changeset
|
129 if ( (signed __int64)v5->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && v5->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > v7 ) |
f92fc67d66cb
pActorBuffs[16] to pActorBuffs[ACTOR_BUFF_STONESKIN]
Grumpy7
parents:
1959
diff
changeset
|
130 v7 = v5->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower; |
0 | 131 v10 = v7 + v6; |
1958
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
132 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) |
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
133 a2a = pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; |
1961 | 134 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower > a2a ) |
135 a2a = pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower; | |
1955 | 136 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 ) |
0 | 137 { |
1955 | 138 a2a += pActor->pActorBuffs[ACTOR_BUFF_FATE].uPower; |
139 pActor->pActorBuffs[ACTOR_BUFF_FATE].Reset(); | |
0 | 140 } |
141 return rand() % (v10 + 2 * pActor->pMonsterInfo.uLevel + 10) + a2a + 1 > v10 + 5; | |
142 } | |
143 | |
144 //----- (004274AD) -------------------------------------------------------- | |
145 bool stru319::ActorHitOrMiss(Actor *pActor, Player *pPlayer) | |
146 { | |
147 signed int v3; // edi@1 | |
148 signed int v4; // esi@8 | |
149 int v5; // esi@8 | |
150 | |
151 v3 = 0; | |
1958
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
152 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) |
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
153 v3 = pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; |
1961 | 154 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_BLESS].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower > v3 ) |
155 v3 = pActor->pActorBuffs[ACTOR_BUFF_BLESS].uPower; | |
1955 | 156 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_FATE].uExpireTime > 0 ) |
0 | 157 { |
1955 | 158 v3 += pActor->pActorBuffs[ACTOR_BUFF_FATE].uPower; |
159 pActor->pActorBuffs[ACTOR_BUFF_FATE].Reset(); | |
0 | 160 } |
161 v4 = pPlayer->GetActualAC() + 2 * pActor->pMonsterInfo.uLevel + 10; | |
162 v5 = rand() % v4 + 1; | |
163 return v3 + v5 > pPlayer->GetActualAC() + 5; | |
164 } | |
165 | |
166 //----- (00427546) -------------------------------------------------------- | |
167 int stru319::_427546(int a2) | |
168 { | |
169 int result; // eax@2 | |
170 | |
171 if ( a2 >= 0 ) | |
172 { | |
173 if ( a2 >= 1 ) | |
174 result = (a2 >= 2) + 2; | |
175 else | |
176 result = 1; | |
177 } | |
178 else | |
179 { | |
180 result = 0; | |
181 } | |
182 return result; | |
183 } | |
184 | |
185 //----- (0042756B) -------------------------------------------------------- | |
186 int stru319::CalcMagicalDamageToActor(Actor *pActor, int a2, signed int a3) | |
187 { | |
188 int v4; // edx@1 | |
189 int v5; // ecx@1 | |
190 signed int v6; // eax@4 | |
191 signed int result; // eax@17 | |
192 signed int v8; // esi@18 | |
193 | |
194 v4 = 0; | |
195 v5 = 0; | |
1958
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
196 if ( (signed __int64)pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) |
95095c2a5e19
pActorBuffs[14] to pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER]
Grumpy7
parents:
1957
diff
changeset
|
197 v5 = pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uPower; |
0 | 198 switch ( a2 ) |
199 { | |
200 case 0: | |
201 v6 = pActor->pMonsterInfo.uResFire; | |
1419 | 202 v4 = v5; |
203 break; | |
0 | 204 case 1: |
205 v6 = pActor->pMonsterInfo.uResAir; | |
1419 | 206 v4 = v5; |
207 break; | |
0 | 208 case 2: |
209 v6 = pActor->pMonsterInfo.uResWater; | |
1419 | 210 v4 = v5; |
211 break; | |
0 | 212 case 3: |
213 v6 = pActor->pMonsterInfo.uResEarth; | |
1419 | 214 v4 = v5; |
215 break; | |
1765 | 216 case 4: |
217 v6 = pActor->pMonsterInfo.uResPhysical; | |
218 break; | |
0 | 219 case 6: |
220 v6 = pActor->pMonsterInfo.uResSpirit; | |
221 break; | |
222 case 7: | |
223 v6 = pActor->pMonsterInfo.uResMind; | |
1419 | 224 v4 = v5; |
225 break; | |
0 | 226 case 8: |
227 v6 = pActor->pMonsterInfo.uResBody; | |
228 v4 = v5; | |
229 break; | |
230 case 9: | |
231 v6 = pActor->pMonsterInfo.uResLight; | |
232 break; | |
233 case 10: | |
234 v6 = pActor->pMonsterInfo.uResDark; | |
235 break; | |
236 default: | |
237 v6 = 0; | |
238 break; | |
239 } | |
240 if ( v6 < 200 ) | |
241 { | |
242 v8 = v4 + v6 + 30; | |
243 if ( rand() % v8 >= 30 ) | |
244 { | |
245 a3 >>= 1; | |
246 if ( rand() % v8 >= 30 ) | |
247 { | |
248 a3 >>= 1; | |
249 if ( rand() % v8 >= 30 ) | |
250 { | |
251 a3 >>= 1; | |
252 if ( rand() % v8 >= 30 ) | |
253 a3 >>= 1; | |
254 } | |
255 } | |
256 } | |
257 result = a3; | |
258 } | |
259 else | |
260 { | |
261 result = 0; | |
262 } | |
263 return result; | |
264 } | |
265 | |
266 //----- (00427662) -------------------------------------------------------- | |
267 bool stru319::GetMagicalResistance(Actor *pActor, unsigned int uType) | |
268 { | |
1765 | 269 signed int resist; // esi@2 |
0 | 270 bool result; // eax@13 |
271 | |
272 switch ( uType ) | |
273 { | |
1765 | 274 case 0: |
275 resist = pActor->pMonsterInfo.uResFire; | |
276 break; | |
277 case 1: | |
278 resist = pActor->pMonsterInfo.uResAir; | |
279 break; | |
280 case 2: | |
281 resist = pActor->pMonsterInfo.uResWater; | |
282 break; | |
283 case 3: | |
284 resist = pActor->pMonsterInfo.uResEarth; | |
285 break; | |
286 case 4: | |
287 resist = pActor->pMonsterInfo.uResPhysical; | |
288 break; | |
289 case 6: | |
290 resist = pActor->pMonsterInfo.uResSpirit; | |
291 break; | |
292 case 7: | |
293 resist = pActor->pMonsterInfo.uResMind; | |
294 case 8: | |
295 resist = pActor->pMonsterInfo.uResBody; | |
296 break; | |
297 case 9: | |
298 resist = pActor->pMonsterInfo.uResLight; | |
299 break; | |
300 case 10: | |
301 resist = pActor->pMonsterInfo.uResDark; | |
0 | 302 break; |
303 default: | |
1419 | 304 return 1; |
0 | 305 } |
1765 | 306 if ( resist < 200 ) |
307 result = rand() % (signed int)(((unsigned int)pActor->pMonsterInfo.uLevel >> 2) + resist + 30) < 30; | |
1419 | 308 else |
1765 | 309 result = 0; |
0 | 310 return result; |
311 } | |
312 | |
313 //----- (0042EB8D) -------------------------------------------------------- | |
437 | 314 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 315 { |
482 | 316 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 317 if (uNumMessages < 40) |
318 { | |
437 | 319 files[uNumMessages] = file; |
320 lines[uNumMessages] = line; | |
321 | |
0 | 322 pMessages[uNumMessages].eType = msg; |
323 pMessages[uNumMessages].param = param; | |
324 pMessages[uNumMessages++].field_8 = a4; | |
325 } | |
326 } | |
327 | |
328 | |
329 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 330 int stru193_math::Sin(int angle) |
0 | 331 { |
323 | 332 return Cos(angle - this->uIntegerHalfPi); |
0 | 333 } |
334 | |
335 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 336 void _42ECB5_PlayerAttacksActor() |
0 | 337 { |
271 | 338 //unsigned int v0; // ebx@1 |
339 //Player *v1; // esi@1 | |
340 //bool result; // eax@1 | |
295 | 341 //int v3; // edi@2 |
271 | 342 //unsigned int v4; // eax@7 |
0 | 343 char *v5; // eax@8 |
271 | 344 //int v6; // ecx@9 |
345 //signed int v7; // eax@16 | |
295 | 346 //Actor *v8; // edi@20 |
0 | 347 unsigned int v9; // ecx@21 |
295 | 348 //char *v10; // eax@26 |
0 | 349 char *v11; // eax@26 |
350 unsigned int v12; // eax@47 | |
295 | 351 //char *v13; // eax@47 |
352 //char *v14; // eax@47 | |
353 //unsigned int v15; // ebx@54 | |
354 //int v16; // [sp-10h] [bp-4Ch]@24 | |
355 //int v17; // [sp-10h] [bp-4Ch]@44 | |
356 //unsigned int v18; // [sp-Ch] [bp-48h]@24 | |
357 //unsigned int v19; // [sp-Ch] [bp-48h]@44 | |
358 //__int16 v20; // [sp-8h] [bp-44h]@24 | |
359 //__int16 v21; // [sp-8h] [bp-44h]@44 | |
360 //int v22; // [sp-4h] [bp-40h]@24 | |
361 //int v23; // [sp-4h] [bp-40h]@44 | |
0 | 362 SoundID v24; // [sp-4h] [bp-40h]@58 |
295 | 363 //Vec3_int_ a3; // [sp+Ch] [bp-30h]@19 |
271 | 364 //unsigned int a2; // [sp+18h] [bp-24h]@20 |
365 //unsigned int v27; // [sp+1Ch] [bp-20h]@1 | |
295 | 366 //int v28; // [sp+20h] [bp-1Ch]@9 |
271 | 367 //unsigned int *v28b; |
295 | 368 //int v29; // [sp+24h] [bp-18h]@16 |
369 //int v30; // [sp+28h] [bp-14h]@16 | |
271 | 370 //int v31; // [sp+2Ch] [bp-10h]@4 |
295 | 371 //int v32; // [sp+30h] [bp-Ch]@7 |
271 | 372 //int v33; // [sp+34h] [bp-8h]@7 |
295 | 373 //int v34; // [sp+38h] [bp-4h]@17 |
0 | 374 |
271 | 375 //v0 = uActiveCharacter; |
376 //v27 = 6972 * uActiveCharacter; | |
377 //v1 = &pParty->pPlayers[uActiveCharacter-1]; | |
378 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); | |
379 auto player = &pParty->pPlayers[uActiveCharacter - 1]; | |
380 if (!player->CanAct()) | |
381 return; | |
382 | |
1517 | 383 CastSpellInfoHelpers::_427D48(); |
295 | 384 //v3 = 0; |
271 | 385 if (pParty->Invisible()) |
386 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
387 | |
388 //v31 = player->pEquipment.uBow; | |
389 int bow_idx = player->pEquipment.uBow; | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1558
diff
changeset
|
390 if (bow_idx && player->pInventoryItemList[bow_idx - 1].IsBroken()) |
271 | 391 bow_idx = 0; |
392 | |
295 | 393 //v32 = 0; |
394 int wand_item_id = 0; | |
271 | 395 //v33 = 0; |
396 //v4 = v1->pEquipment.uMainHand; | |
397 int laser_weapon_item_id = 0; | |
398 | |
399 int main_hand_idx = player->pEquipment.uMainHand; | |
400 if (main_hand_idx) | |
0 | 401 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1340
diff
changeset
|
402 auto item = &player->pInventoryItemList[main_hand_idx - 1]; |
112 | 403 //v5 = (char *)v1 + 36 * v4; |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1558
diff
changeset
|
404 if (!item->IsBroken()) |
271 | 405 { |
406 //v28b = &v1->pInventoryItems[v4].uItemID; | |
407 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1685
diff
changeset
|
408 if (item->GetItemEquipType() == EQUIP_WAND) |
0 | 409 { |
295 | 410 if (item->uNumCharges <= 0) |
411 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 412 else |
295 | 413 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 414 } |
271 | 415 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
416 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 417 } |
271 | 418 } |
419 | |
295 | 420 //v30 = 0; |
421 //v29 = 0; | |
422 //v28 = 0; | |
271 | 423 //v7 = pMouse->uPointingObjectID; |
424 | |
425 int target_pid = pMouse->uPointingObjectID; | |
848 | 426 int target_type = PID_TYPE(target_pid), |
427 target_id = PID_ID(target_pid); | |
271 | 428 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) |
429 { | |
430 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
848 | 431 target_type = PID_TYPE(target_pid); |
432 target_id = PID_ID(target_pid); | |
271 | 433 } |
295 | 434 |
435 auto actor = &pActors[target_id]; | |
436 int actor_distance = 0; | |
271 | 437 if (target_type == OBJECT_Actor) |
438 { | |
295 | 439 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
440 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
441 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
442 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
443 if (actor_distance < 0) | |
444 actor_distance = 0; | |
445 } | |
446 | |
447 bool shooting_bow = false, | |
448 shotting_laser = false, | |
816 | 449 shooting_wand = false, |
450 melee_attack = false; | |
295 | 451 if (laser_weapon_item_id) |
452 { | |
453 shotting_laser = true; | |
490 | 454 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
295 | 455 } |
456 else if (wand_item_id) | |
457 { | |
458 shooting_wand = true; | |
459 | |
460 int main_hand_idx = player->pEquipment.uMainHand; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1340
diff
changeset
|
461 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItemList[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
295 | 462 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1340
diff
changeset
|
463 if (!--player->pInventoryItemList[main_hand_idx - 1].uNumCharges) |
295 | 464 player->pEquipment.uMainHand = 0; |
465 } | |
303 | 466 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 467 { |
816 | 468 melee_attack = true; |
469 | |
303 | 470 Vec3_int_ a3; |
471 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
472 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
473 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
474 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
475 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
476 DamageMonsterFromParty(PID(OBJECT_Player, uActiveCharacter - 1), target_id, &a3); |
1080 | 477 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_MAIN_HAND) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_OFF_HAND)) |
295 | 478 _42FA66_do_explosive_impact( |
479 actor->vPosition.x, | |
480 actor->vPosition.y, | |
481 actor->vPosition.z + actor->uActorHeight / 2, | |
482 0, 512, uActiveCharacter); | |
303 | 483 } |
484 else if (bow_idx) | |
485 { | |
486 shooting_bow = true; | |
490 | 487 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
295 | 488 } |
489 else | |
490 { | |
816 | 491 melee_attack = true; |
303 | 492 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
493 } | |
494 | |
816 | 495 if (!pParty->bTurnBasedModeOn && melee_attack) // wands, bows & lasers will add recovery while shooting spell effect |
303 | 496 { |
816 | 497 int recovery = player->GetAttackRecoveryTime(false); |
303 | 498 if (recovery < 30 ) |
499 recovery = 30; | |
816 | 500 player->SetRecoveryTime(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333); |
295 | 501 } |
502 | |
503 | |
504 int v34 = 0; | |
505 if (shooting_wand) | |
506 return; | |
507 else if (shooting_bow) | |
508 { | |
509 v34 = 5; | |
510 player->PlaySound(SPEECH_50, 0); | |
511 } | |
512 if (shotting_laser) | |
513 v34 = 7; | |
514 else | |
515 { | |
516 int main_hand_idx = player->pEquipment.uMainHand; | |
816 | 517 if (player->HasItemEquipped(EQUIP_MAIN_HAND)) |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1685
diff
changeset
|
518 v34 = player->pInventoryItemList[main_hand_idx - 1].GetPlayerSkillType(); |
1448 | 519 pTurnEngine->ApplyPlayerAction(); |
295 | 520 } |
521 | |
522 switch (v34) | |
523 { | |
524 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
525 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
526 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
527 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
528 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
529 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
530 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
531 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
532 } | |
0 | 533 } |
534 | |
535 //----- (0042F184) -------------------------------------------------------- | |
295 | 536 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 537 { |
538 int v4; // edi@1 | |
539 stru319 *v5; // esi@1 | |
540 int v6; // eax@2 | |
541 int v7; // eax@4 | |
542 int result; // eax@5 | |
543 int *v9; // edx@8 | |
544 signed int v10; // ebx@10 | |
545 int v11; // edi@11 | |
546 Actor *v12; // esi@12 | |
547 unsigned __int16 v13; // ax@12 | |
548 int v14; // eax@22 | |
549 char v15; // zf@30 | |
550 int v16; // esi@32 | |
551 int v17; // ecx@34 | |
552 stru319 *v18; // eax@39 | |
553 int v19; // edx@39 | |
554 int v20; // ecx@41 | |
555 unsigned __int16 v21; // ax@42 | |
556 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
557 unsigned int v23; // [sp+Ch] [bp-20h]@7 | |
558 stru319 *v24; // [sp+10h] [bp-1Ch]@1 | |
559 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
560 int *v26; // [sp+18h] [bp-14h]@8 | |
561 int v27; // [sp+1Ch] [bp-10h]@10 | |
562 int *v28; // [sp+20h] [bp-Ch]@10 | |
563 unsigned int v29; // [sp+24h] [bp-8h]@7 | |
564 int v30; // [sp+28h] [bp-4h]@6 | |
565 int i; // [sp+38h] [bp+Ch]@33 | |
566 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
567 | |
568 v4 = 0; | |
569 v5 = this; | |
570 v24 = this; | |
571 if ( pRenderer->pRenderD3D ) | |
572 { | |
573 v6 = a3 != 0; | |
574 if ( a4 ) | |
575 LOBYTE(v6) = v6 | 8; | |
295 | 576 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 577 if ( v7 != -1 ) |
578 return (unsigned __int16)v7; | |
295 | 579 else return 0; |
0 | 580 } |
581 else | |
582 { | |
583 v30 = 0; | |
584 if ( pRenderer->pActiveZBuffer ) | |
585 { | |
692 | 586 v29 = viewparams->uScreen_topL_X; |
587 v23 = viewparams->uScreen_BttmR_X; | |
588 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y ) | |
0 | 589 { |
692 | 590 v25 = viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y; |
591 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y]; | |
592 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y]; | |
0 | 593 do |
594 { | |
595 if ( (signed int)v29 < (signed int)v23 ) | |
596 { | |
597 v28 = v9; | |
598 v10 = v4; | |
599 v27 = v23 - v29; | |
600 do | |
601 { | |
602 v22 = *v28; | |
603 v11 = *v28 & 0xFFFF; | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
604 if (PID_TYPE(v11) == OBJECT_Actor) |
0 | 605 { |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
606 v12 = &pActors[PID_ID(v11)]; |
0 | 607 v13 = v12->uAIState; |
608 if ( v13 != 5 ) | |
609 { | |
610 if ( v13 != 4 | |
611 && v13 != 11 | |
612 && v13 != 19 | |
613 && v13 != 17 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
614 && (!a3 || pActors[PID_ID(v11)].GetActorsRelation(0)) ) |
0 | 615 { |
616 if ( (!a4 || MonsterStats::BelongsToSupertype(v12->pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
295 | 617 && v22 <= pick_depth << 16 ) |
0 | 618 { |
619 v14 = 0; | |
620 if ( v10 > 0 ) | |
621 { | |
622 do | |
623 { | |
624 if ( dword_50BDA0[v14] == v11 ) | |
625 break; | |
626 ++v14; | |
627 } | |
628 while ( v14 < v30 ); | |
629 } | |
630 if ( v14 == v30 && v10 < 100 ) | |
631 { | |
632 ++v30; | |
633 dword_50BC10[v10] = v22; | |
634 dword_50BDA0[v10] = v11; | |
635 ++v10; | |
636 } | |
637 } | |
638 } | |
639 } | |
640 } | |
641 ++v28; | |
642 --v27; | |
643 } | |
644 while ( v27 ); | |
645 v4 = v30; | |
646 v5 = v24; | |
647 } | |
648 v9 = v26 + 640; | |
649 v15 = v25-- == 1; | |
650 v26 += 640; | |
651 } | |
652 while ( !v15 ); | |
653 } | |
654 if ( v4 > 0 ) | |
655 { | |
656 v32 = 1; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
657 v16 = (int)dword_50BC10.data(); |
0 | 658 do |
659 { | |
660 for ( i = v32; i < v4; ++i ) | |
661 { | |
662 v17 = dword_50BC10[i]; | |
663 if ( v17 < *(int *)v16 ) | |
664 { | |
665 dword_50BC10[i] = *(int *)v16; | |
666 *(int *)v16 = v17; | |
667 } | |
668 } | |
669 ++v32; | |
670 v16 += 4; | |
671 } | |
672 while ( v32 - 1 < v4 ); | |
673 v5 = v24; | |
674 if ( v4 > 0 ) | |
675 { | |
676 v18 = v24; | |
677 v19 = v4; | |
678 do | |
679 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
680 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10.data() - (char *)v24].field_0 >> 3) & 0x1FFF; |
0 | 681 v18 += 4; |
682 --v19; | |
683 } | |
684 while ( v19 ); | |
685 } | |
686 } | |
687 v20 = 0; | |
688 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
689 { | |
690 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
691 if ( v21 != 4 && v21 != 5 ) | |
692 break; | |
693 } | |
694 if ( v20 != v4 ) | |
695 { | |
696 result = 8 * *(int *)&v5[4 * v20].field_0; | |
697 LOBYTE(result) = result | 3; | |
698 return result; | |
699 } | |
700 } | |
701 } | |
702 return 0; | |
703 } | |
704 | |
705 //----- (0042F3D6) -------------------------------------------------------- | |
706 void InitializeTurnBasedAnimations(void *_this) | |
707 { | |
708 unsigned int *v1; // edi@1 | |
709 | |
710 pIconIDs_Turn[0] = pIconsFrameTable->FindIcon("turn0"); | |
711 pIconIDs_Turn[1] = pIconsFrameTable->FindIcon("turn1"); | |
712 pIconIDs_Turn[2] = pIconsFrameTable->FindIcon("turn2"); | |
713 pIconIDs_Turn[3] = pIconsFrameTable->FindIcon("turn3"); | |
714 pIconIDs_Turn[4] = pIconsFrameTable->FindIcon("turn4"); | |
715 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
716 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
717 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
718 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
719 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
720 v1 = pIconIDs_Turn.data(); |
0 | 721 do |
722 { | |
723 pIconsFrameTable->InitializeAnimation(*v1); | |
724 ++v1; | |
725 } | |
726 while ( (signed int)v1 < (signed int)&uIconID_TurnStop ); | |
727 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); | |
728 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
729 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
730 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
731 } | |
732 | |
733 //----- (0042F7EB) -------------------------------------------------------- | |
734 bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9) | |
735 { | |
1406 | 736 unsigned __int16 pObjectDescID; // ax@7 |
737 SpriteObject pSpellObject; // [sp+Ch] [bp-78h]@1 | |
0 | 738 |
1406 | 739 pSpellObject.stru_24.Reset(); |
0 | 740 if ( a9 ) |
1406 | 741 memcpy(&pSpellObject.stru_24, a9, sizeof(pSpellObject.stru_24)); |
742 pSpellObject.spell_skill = 0; | |
743 pSpellObject.spell_level = 0; | |
744 pSpellObject.spell_id = 0; | |
745 pSpellObject.field_54 = 0; | |
746 pSpellObject.uType = uSpriteID; | |
0 | 747 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
1406 | 748 pObjectDescID = 0; |
0 | 749 else |
750 { | |
1406 | 751 pObjectDescID = 0; |
752 for ( uint i = 0; i < (signed int)pObjectList->uNumObjects; ++i ) | |
0 | 753 { |
1406 | 754 if ( (short)uSpriteID == pObjectList->pObjects[i].uObjectID ) |
755 pObjectDescID = i; | |
0 | 756 } |
757 } | |
1406 | 758 pSpellObject.uObjectDescID = pObjectDescID; |
759 pSpellObject.vPosition.x = x; | |
760 pSpellObject.vPosition.y = y; | |
761 pSpellObject.vPosition.z = z; | |
762 pSpellObject.uSoundID = 0; | |
763 pSpellObject.uAttributes = attributes; | |
764 pSpellObject.uSectorID = pIndoor->GetSector(x, y, z); | |
765 pSpellObject.uSpriteFrameID = 0; | |
766 pSpellObject.spell_caster_pid = 0; | |
767 pSpellObject.spell_target_pid = 0; | |
768 if ( !(pSpellObject.uAttributes & 0x10) ) | |
769 { | |
770 if ( pItemsTable->uAllItemsCount ) | |
771 { | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1709
diff
changeset
|
772 for ( uint i = 1; i < pItemsTable->uAllItemsCount; ++i ) |
1406 | 773 { |
774 if ( pItemsTable->pItems[i].uSpriteID == uSpriteID ) | |
775 pSpellObject.stru_24.uItemID = i; | |
776 } | |
777 } | |
778 } | |
0 | 779 if ( a7 ) |
780 { | |
781 if ( count > 0 ) | |
782 { | |
1406 | 783 for ( uint i = count; i; --i ) |
0 | 784 { |
1406 | 785 pSpellObject.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; |
786 pSpellObject.Create((signed __int16)pSpellObject.uFacing, | |
787 ((signed int)stru_5C6E00->uIntegerHalfPi / 2) + (rand() % ((signed int)stru_5C6E00->uIntegerHalfPi / 2)), a4, 0); | |
788 | |
0 | 789 } |
790 } | |
791 } | |
792 else | |
793 { | |
1406 | 794 pSpellObject.uFacing = 0; |
0 | 795 if ( count > 0 ) |
796 { | |
1406 | 797 for ( uint i = count; i; --i ) |
0 | 798 { |
1406 | 799 pSpellObject.Create((signed __int16)pSpellObject.uFacing, stru_5C6E00->uIntegerHalfPi, a4, 0); |
0 | 800 } |
801 } | |
802 } | |
1406 | 803 return true; |
0 | 804 } |
805 | |
806 //----- (0042F960) -------------------------------------------------------- | |
807 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
808 { | |
809 int v3; // ebx@1 | |
810 int v4; // edi@1 | |
811 signed int v5; // edx@1 | |
812 char *v6; // ecx@2 | |
813 unsigned __int16 v7; // ax@5 | |
814 signed int v8; // eax@6 | |
815 signed int v9; // eax@7 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
816 //SpriteObject a1; // [sp+Ch] [bp-70h]@1 |
0 | 817 |
818 v3 = x; | |
819 v4 = y; | |
820 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
821 SpriteObject a1; // [sp+Ch] [bp-70h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
822 //SpriteObject::SpriteObject(&a1); |
0 | 823 a1.stru_24.Reset(); |
824 | |
825 v5 = 0; | |
822 | 826 a1.spell_skill = 0; |
827 a1.spell_level = 0; | |
828 a1.spell_id = 0; | |
0 | 829 a1.field_54 = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
830 a1.uType = 800; |
0 | 831 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
832 { | |
833 LABEL_5: | |
834 v7 = 0; | |
835 } | |
836 else | |
837 { | |
838 v6 = (char *)&pObjectList->pObjects->uObjectID; | |
839 while ( *(short *)v6 != 800 ) | |
840 { | |
841 ++v5; | |
842 v6 += 56; | |
843 if ( v5 >= (signed int)pObjectList->uNumObjects ) | |
844 goto LABEL_5; | |
845 } | |
846 v7 = v5; | |
847 } | |
848 a1.uObjectDescID = v7; | |
849 a1.vPosition.x = v3; | |
850 a1.vPosition.y = v4; | |
851 a1.vPosition.z = z; | |
852 a1.uSoundID = 0; | |
853 a1.uAttributes = 0; | |
854 a1.uSectorID = pIndoor->GetSector(v3, v4, z); | |
855 a1.uSpriteFrameID = 0; | |
822 | 856 a1.spell_caster_pid = 0; |
823 | 857 a1.spell_target_pid = 0; |
0 | 858 v8 = a1.Create(0, 0, 0, 0); |
859 if ( v8 != -1 ) | |
860 { | |
861 v9 = 8 * v8; | |
862 LOBYTE(v9) = v9 | 2; | |
863 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
864 } | |
865 } | |
866 | |
810 | 867 |
0 | 868 |
869 //----- (0042FA66) -------------------------------------------------------- | |
1546 | 870 void _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) |
0 | 871 { |
872 int v6; // edi@1 | |
873 int v7; // esi@1 | |
874 char *v8; // ecx@2 | |
875 unsigned __int16 v9; // ax@5 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
876 //int v10; // eax@10 |
1546 | 877 //signed int result; // eax@11 |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
878 //__int16 v12; // ax@12 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
879 //SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
0 | 880 int v14; // [sp+7Ch] [bp-4h]@1 |
881 | |
882 v6 = a1; | |
883 v7 = a2; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
884 SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
885 //SpriteObject::SpriteObject(&a1a); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
886 a1a.uType = 600; |
0 | 887 a1a.stru_24.Reset(); |
888 | |
822 | 889 a1a.spell_id = SPELL_FIRE_FIREBALL; |
890 a1a.spell_level = 8; | |
891 a1a.spell_skill = 3; | |
0 | 892 v14 = 0; |
893 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
894 { | |
895 LABEL_5: | |
896 v9 = 0; | |
897 } | |
898 else | |
899 { | |
900 v8 = (char *)&pObjectList->pObjects->uObjectID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
901 while ( (short)a1a.uType != *(short *)v8 ) |
0 | 902 { |
903 ++v14; | |
904 v8 += 56; | |
905 if ( v14 >= (signed int)pObjectList->uNumObjects ) | |
906 goto LABEL_5; | |
907 } | |
908 v9 = v14; | |
909 } | |
910 a1a.uObjectDescID = v9; | |
911 a1a.vPosition.x = v6; | |
912 a1a.vPosition.y = v7; | |
913 a1a.vPosition.z = a3; | |
914 a1a.uAttributes = 0; | |
915 a1a.uSectorID = pIndoor->GetSector(v6, v7, a3); | |
916 a1a.uSpriteFrameID = 0; | |
823 | 917 a1a.spell_target_pid = 0; |
0 | 918 a1a.field_60_distance_related_prolly_lod = 0; |
919 a1a.uFacing = 0; | |
920 a1a.uSoundID = 0; | |
921 if ( a6 >= 1 || a6 <= 4 ) | |
922 { | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
923 a1a.spell_caster_pid = PID(OBJECT_Player, a6 - 1); |
0 | 924 } |
925 else | |
926 { | |
822 | 927 a1a.spell_caster_pid = 0; |
0 | 928 } |
1546 | 929 |
930 int id = a1a.Create(0, 0, 0, 0); | |
931 if (id != -1) | |
932 stru_50FE08.Add(PID(OBJECT_Item, id), | |
0 | 933 a5, |
934 SLOWORD(a1a.vPosition.x), | |
935 SLOWORD(a1a.vPosition.y), | |
936 SLOWORD(a1a.vPosition.z), | |
937 0, | |
938 0); | |
939 } | |
940 | |
941 //----- (0042FB5C) -------------------------------------------------------- | |
1458 | 942 bool _42FB5C_check_spell(signed int a1) |
0 | 943 { |
944 int v1; // ecx@3 | |
945 int v2; // ecx@4 | |
946 int v3; // ecx@5 | |
947 int v4; // ecx@6 | |
948 int v5; // ecx@7 | |
949 int v6; // ecx@8 | |
950 char v7; // zf@9 | |
951 | |
952 if ( a1 > 39 ) | |
953 { | |
954 if ( a1 > 77 ) | |
955 { | |
956 if ( a1 == 80 ) | |
957 return 0; | |
958 if ( a1 > 84 ) | |
959 { | |
960 if ( a1 <= 86 ) | |
961 return 0; | |
962 v7 = a1 == 95; | |
963 goto LABEL_20; | |
964 } | |
965 } | |
966 else | |
967 { | |
968 if ( a1 == 77 ) | |
969 return 0; | |
970 if ( a1 >= 46 ) | |
971 { | |
972 if ( a1 <= 47 || a1 == 51 ) | |
973 return 0; | |
974 v7 = a1 == 73; | |
975 goto LABEL_20; | |
976 } | |
977 } | |
978 return 1; | |
979 } | |
980 if ( a1 == 39 || (v1 = a1 - 2) == 0 ) | |
981 return 1; | |
982 v2 = v1 - 3; | |
983 if ( !v2 ) | |
984 return 0; | |
985 v3 = v2 - 1; | |
986 if ( !v3 || (v4 = v3 - 3) == 0 ) | |
987 return 1; | |
988 v5 = v4 - 8; | |
989 if ( !v5 ) | |
990 return 0; | |
991 v6 = v5 - 1; | |
992 if ( !v6 ) | |
993 return 1; | |
994 v7 = v6 == 20; | |
995 LABEL_20: | |
996 if ( !v7 ) | |
997 return 1; | |
998 return 0; | |
999 } | |
1000 | |
1001 //----- (0042FBDD) -------------------------------------------------------- | |
1458 | 1002 void sub_42FBDD() |
0 | 1003 { |
388 | 1004 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 1005 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
1006 pRenderer->Present(); | |
1007 } | |
1008 | |
1009 //----- (0042FC15) -------------------------------------------------------- | |
1458 | 1010 void CloseWindowBackground() |
0 | 1011 { |
388 | 1012 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 1013 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
1014 pRenderer->Present(); | |
1015 } | |
1016 | |
1017 //----- (0042FC4E) -------------------------------------------------------- | |
1575 | 1018 void ProcessInputActions() |
0 | 1019 { |
1020 char v4; // al@9 | |
1021 char v8; // bl@100 | |
1022 unsigned __int16 v9; // ax@102 | |
1023 int v10; // eax@103 | |
1024 char v14; // al@159 | |
1025 unsigned int v15; // eax@168 | |
1026 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
1027 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
1028 int v24; // [sp+4h] [bp-4h]@87 | |
1029 | |
1030 pGame->pKeyboardInstance->EnterCriticalSection(); | |
1031 auto pKeyboard = pGame->pKeyboardInstance; | |
1032 if (!bAlwaysRun) | |
1033 { | |
1034 if (pKeyboard->IsShiftHeld()) | |
1035 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
1036 else | |
1037 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
1038 } | |
1039 else | |
1040 { | |
1041 if (pKeyboard->IsShiftHeld()) | |
1042 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
1043 else | |
1044 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
1045 } | |
1046 | |
140 | 1047 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
1052 | 1048 |
1049 | |
1050 // WUT? double event trigger | |
1051 /*for ( uint i = 0; i < 30; ++i ) | |
998 | 1052 { |
1053 if ( pKeyActionMap->pToggleTypes[i] ) | |
1054 v14 = pGame->pKeyboardInstance->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[i]); | |
1055 else | |
1056 v14 = pGame->pKeyboardInstance->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[i]); | |
1052 | 1057 if ( v14 ) |
998 | 1058 { |
1052 | 1059 if (pCurrentScreen == SCREEN_GAME) |
998 | 1060 { |
1061 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
1062 continue; | |
1063 } | |
1064 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
1065 { | |
1066 v15 = pMessageQueue_50CBD0->uNumMessages; | |
1067 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1068 { | |
1069 v15 = 0; | |
1070 if ( pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 ) | |
1071 { | |
1072 v15 = 1; | |
1073 pMessageQueue_50CBD0->uNumMessages = 0; | |
1074 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; | |
1075 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
1076 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
1077 ++pMessageQueue_50CBD0->uNumMessages; | |
1078 continue; | |
1079 } | |
1080 pMessageQueue_50CBD0->uNumMessages = 0; | |
1081 } | |
1082 //pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1083 } | |
1084 } | |
1052 | 1085 }*/ |
0 | 1086 if ( !pEventTimer->bPaused ) |
1087 { | |
998 | 1088 for ( uint i = 0; i < 30; ++i ) |
0 | 1089 { |
998 | 1090 inputAction = (InputAction)i; |
1091 if ( pKeyActionMap->pToggleTypes[(InputAction)i] ) | |
1092 v4 = pKeyboard->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[(InputAction)i]); | |
0 | 1093 else |
998 | 1094 v4 = pKeyboard->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[(InputAction)i]); |
0 | 1095 if ( v4 ) |
1096 { | |
1097 switch ( inputAction ) | |
1098 { | |
1099 case INPUT_MoveForward: | |
271 | 1100 if (pCurrentScreen != SCREEN_GAME) |
0 | 1101 break; |
1102 if (!pParty->bTurnBasedModeOn) | |
1103 { | |
140 | 1104 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 1105 partyAction = PARTY_RunForward; |
1106 else | |
1107 partyAction = PARTY_WalkForward; | |
998 | 1108 pPartyActionQueue->Add(partyAction); |
163 | 1109 break; |
1110 } | |
1340 | 1111 if (pTurnEngine->turn_stage != 1 && pTurnEngine->turn_stage != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
163 | 1112 { |
1113 pTurnEngine->uActionPointsLeft -= 26; | |
1114 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
1115 partyAction = PARTY_RunForward; | |
1116 else | |
1117 partyAction = PARTY_WalkForward; | |
998 | 1118 pPartyActionQueue->Add(partyAction); |
163 | 1119 break; |
0 | 1120 } |
1121 break; | |
1122 case INPUT_MoveBackwards: | |
271 | 1123 if (pCurrentScreen != SCREEN_GAME) |
0 | 1124 break; |
1125 if (!pParty->bTurnBasedModeOn) | |
17 | 1126 { |
1127 if ( pParty->uFlags2 & 2 ) | |
1128 partyAction = PARTY_RunBackward; | |
1129 else | |
1130 partyAction = PARTY_WalkBackward; | |
998 | 1131 pPartyActionQueue->Add(partyAction); |
163 | 1132 break; |
17 | 1133 } |
1340 | 1134 if ( pTurnEngine->turn_stage != 1 && pTurnEngine->turn_stage != 2 && pTurnEngine->uActionPointsLeft > 0 ) |
0 | 1135 { |
1136 pTurnEngine->uActionPointsLeft -= 26; | |
1137 if ( pParty->uFlags2 & 2 ) | |
1138 partyAction = PARTY_RunBackward; | |
1139 else | |
1140 partyAction = PARTY_WalkBackward; | |
998 | 1141 pPartyActionQueue->Add(partyAction); |
163 | 1142 break; |
0 | 1143 } |
1144 break; | |
1145 case INPUT_StrafeLeft: | |
271 | 1146 if (pCurrentScreen != SCREEN_GAME) |
0 | 1147 break; |
1148 if (!pParty->bTurnBasedModeOn) | |
17 | 1149 { |
1150 partyAction = PARTY_StrafeLeft; | |
998 | 1151 pPartyActionQueue->Add(partyAction); |
163 | 1152 break; |
17 | 1153 } |
1340 | 1154 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 1155 break; |
1156 pTurnEngine->uActionPointsLeft -= 26; | |
1157 partyAction = PARTY_StrafeLeft; | |
998 | 1158 pPartyActionQueue->Add(partyAction); |
1159 break; | |
0 | 1160 case INPUT_StrafeRight: |
271 | 1161 if (pCurrentScreen != SCREEN_GAME) |
0 | 1162 break; |
1163 if (!pParty->bTurnBasedModeOn) | |
17 | 1164 { |
1165 partyAction = PARTY_StrafeRight; | |
998 | 1166 pPartyActionQueue->Add(partyAction); |
163 | 1167 break; |
17 | 1168 } |
1340 | 1169 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 1170 break; |
1171 pTurnEngine->uActionPointsLeft -= 26; | |
1172 partyAction = PARTY_StrafeRight; | |
998 | 1173 pPartyActionQueue->Add(partyAction); |
163 | 1174 break; |
0 | 1175 case INPUT_TurnLeft: |
271 | 1176 if (pCurrentScreen != SCREEN_GAME) |
0 | 1177 break; |
1178 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
1179 { | |
1180 if (pParty->bTurnBasedModeOn) | |
1181 { | |
1340 | 1182 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 1183 break; |
1184 pTurnEngine->uActionPointsLeft -= 26; | |
1185 } | |
998 | 1186 partyAction = PARTY_StrafeLeft; |
0 | 1187 } |
1188 else | |
1189 { | |
1190 if ( pParty->uFlags2 & 2 ) | |
998 | 1191 partyAction = PARTY_FastTurnLeft; |
0 | 1192 else |
998 | 1193 partyAction = PARTY_TurnLeft; |
0 | 1194 } |
998 | 1195 pPartyActionQueue->Add(partyAction); |
0 | 1196 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) |
1197 { | |
271 | 1198 pWeather->OnPlayerTurn(10); |
0 | 1199 } |
1200 break; | |
1201 case INPUT_TurnRight: | |
271 | 1202 if (pCurrentScreen != SCREEN_GAME) |
0 | 1203 break; |
1204 if ( GetAsyncKeyState(17) ) // strafing | |
1205 { | |
1206 if (pParty->bTurnBasedModeOn) | |
1207 { | |
1340 | 1208 if ( pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 2 || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 1209 break; |
1210 pTurnEngine->uActionPointsLeft -= 26; | |
1211 } | |
998 | 1212 partyAction = PARTY_StrafeRight; |
0 | 1213 } |
1214 else | |
1215 { | |
1216 if ( pParty->uFlags2 & 2 ) | |
998 | 1217 partyAction = PARTY_FastTurnRight; |
0 | 1218 else |
998 | 1219 partyAction = PARTY_TurnRight; |
0 | 1220 } |
998 | 1221 pPartyActionQueue->Add(partyAction); |
0 | 1222 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) |
1223 { | |
271 | 1224 pWeather->OnPlayerTurn(-10); |
0 | 1225 } |
1226 break; | |
1227 case INPUT_Jump: | |
271 | 1228 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 1229 break; |
1230 partyAction = (PartyAction)12; | |
998 | 1231 pPartyActionQueue->Add(partyAction); |
163 | 1232 break; |
0 | 1233 case INPUT_Yell: |
187 | 1234 if (!pCurrentScreen && uActiveCharacter) |
0 | 1235 { |
1236 pParty->Yell(); | |
187 | 1237 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 1238 } |
187 | 1239 break; |
0 | 1240 case INPUT_Pass: |
1241 if ( pCurrentScreen ) | |
1242 break; | |
1340 | 1243 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == 3) |
17 | 1244 { |
1332 | 1245 pTurnEngine->field_18 |= TE_FLAG_8; |
17 | 1246 break; |
1247 } | |
0 | 1248 if ( uActiveCharacter ) |
1249 { | |
998 | 1250 if ( !pPlayers[uActiveCharacter]->uTimeToRecovery ) |
0 | 1251 { |
998 | 1252 v24 = pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false); |
0 | 1253 if ( !pParty->bTurnBasedModeOn ) |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
1254 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)v24 * 2.133333333333333)); |
1517 | 1255 CastSpellInfoHelpers::_427D48(); |
1448 | 1256 pTurnEngine->ApplyPlayerAction(); |
0 | 1257 } |
1258 } | |
1259 break; | |
998 | 1260 case INPUT_Combat://if press ENTER |
271 | 1261 if (pCurrentScreen == SCREEN_GAME) |
0 | 1262 { |
1263 if (pParty->bTurnBasedModeOn) | |
1264 { | |
1340 | 1265 if (pTurnEngine->turn_stage == 3 || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) |
0 | 1266 { |
1267 pParty->bTurnBasedModeOn = 0; | |
1268 pTurnEngine->End(true); | |
1269 } | |
1270 } | |
1271 else | |
1272 { | |
1273 pTurnEngine->Start(); | |
1274 pParty->bTurnBasedModeOn = true; | |
1275 } | |
1276 } | |
1277 break; | |
1278 case INPUT_CastReady: | |
271 | 1279 if (pCurrentScreen != SCREEN_GAME) |
0 | 1280 break; |
1340 | 1281 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == 3) |
17 | 1282 { |
1332 | 1283 pTurnEngine->field_18 |= TE_FLAG_8; |
17 | 1284 break; |
1285 } | |
0 | 1286 if ( !uActiveCharacter ) |
1287 break; | |
998 | 1288 v8 = pPlayers[uActiveCharacter]->uQuickSpell; |
0 | 1289 if ( !v8 |
1290 || bUnderwater | |
998 | 1291 || ((v9 = pPlayers[uActiveCharacter]->pActiveSkills[(unsigned __int8)v8 / 11 + 12], !(HIBYTE(v9) & 1)) ? |
1292 ((v9 & 0x80u) == 0 ? (!(v9 & 0x40) ? (v10 = *(&pSpellDatas[0].uNormalLevelMana + 10 * (unsigned __int8)v8)) : | |
1293 (v10 = *(&pSpellDatas[0].uExpertLevelMana + 10 * (unsigned __int8)v8))) : | |
1294 (v10 = *(&pSpellDatas[0].uMasterLevelMana + 10 * (unsigned __int8)v8))) : | |
1295 (v10 = *(&pSpellDatas[0].uMagisterLevelMana + 10 * (unsigned __int8)v8)), | |
1296 v10 > pPlayers[uActiveCharacter]->sMana) ) | |
0 | 1297 { |
998 | 1298 pPartyActionQueue = pPartyActionQueue; |
437 | 1299 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
1300 break; | |
0 | 1301 } |
1302 else | |
1303 { | |
1012 | 1304 pMessageQueue_50C9E8->AddMessage(UIMSG_CastQuickSpell, 0, 0); |
0 | 1305 } |
1306 break; | |
1307 case INPUT_Attack: | |
271 | 1308 if (pCurrentScreen != SCREEN_GAME) |
0 | 1309 break; |
1340 | 1310 if (pParty->bTurnBasedModeOn == 1 && pTurnEngine->turn_stage == 3) |
998 | 1311 { |
1332 | 1312 pTurnEngine->field_18 |= TE_FLAG_8; |
998 | 1313 break; |
1314 } | |
1315 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); | |
0 | 1316 break; |
1317 case INPUT_EventTrigger: | |
271 | 1318 if (pCurrentScreen == SCREEN_GAME) |
0 | 1319 { |
437 | 1320 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); |
163 | 1321 break; |
0 | 1322 } |
151 | 1323 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 1324 { |
1325 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1326 { | |
437 | 1327 pMessageQueue_50CBD0->uNumMessages = 0; |
0 | 1328 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
1329 { | |
1330 pMessageQueue_50CBD0->uNumMessages = 1; | |
998 | 1331 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 1332 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
1575 | 1333 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 = 0; |
0 | 1334 ++pMessageQueue_50CBD0->uNumMessages; |
1335 break; | |
1336 } | |
437 | 1337 break; |
0 | 1338 } |
437 | 1339 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
0 | 1340 } |
1341 break; | |
1342 case INPUT_CharCycle: | |
1012 | 1343 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) |
0 | 1344 break; |
1575 | 1345 |
1012 | 1346 pMessageQueue_50C9E8->AddMessage(UIMSG_CycleCharacters, 0, 0); |
163 | 1347 break; |
0 | 1348 case INPUT_LookUp: |
1349 if ( pEventTimer->bPaused ) | |
1350 break; | |
1351 partyAction = (PartyAction)7; | |
998 | 1352 pPartyActionQueue->Add(partyAction); |
163 | 1353 break; |
0 | 1354 case INPUT_CenterView: |
1355 if ( pEventTimer->bPaused ) | |
1356 break; | |
1357 partyAction = (PartyAction)9; | |
998 | 1358 pPartyActionQueue->Add(partyAction); |
163 | 1359 break; |
0 | 1360 case INPUT_LookDown: |
1361 if ( pEventTimer->bPaused ) | |
1362 break; | |
1363 partyAction = (PartyAction)8; | |
998 | 1364 pPartyActionQueue->Add(partyAction); |
163 | 1365 break; |
0 | 1366 case INPUT_FlyUp: |
998 | 1367 if ( pCurrentScreen || pEventTimer->bPaused ) |
0 | 1368 break; |
1369 partyAction = (PartyAction)13; | |
998 | 1370 pPartyActionQueue->Add(partyAction); |
163 | 1371 break; |
0 | 1372 case INPUT_Land: |
998 | 1373 if ( pCurrentScreen || pEventTimer->bPaused ) |
0 | 1374 break; |
1375 partyAction = (PartyAction)15; | |
998 | 1376 pPartyActionQueue->Add(partyAction); |
163 | 1377 break; |
0 | 1378 case INPUT_FlyDown: |
1379 if ( !pCurrentScreen | |
1380 && !pEventTimer->bPaused ) | |
1381 { | |
1382 partyAction = (PartyAction)14; | |
998 | 1383 pPartyActionQueue->Add(partyAction); |
0 | 1384 } |
1385 break; | |
1386 case INPUT_ZoomIn: | |
1012 | 1387 pMessageQueue_50C9E8->AddMessage(UIMSG_ClickZoomOutBtn, 0, 0); |
163 | 1388 break; |
0 | 1389 case INPUT_ZoomOut: |
1012 | 1390 pMessageQueue_50C9E8->AddMessage(UIMSG_ClickZoomInBtn, 0, 0); |
0 | 1391 break; |
1392 case INPUT_AlwaysRun: | |
1393 bAlwaysRun = bAlwaysRun == 0; | |
1394 break; | |
17 | 1395 default: |
1396 break; | |
0 | 1397 } |
1398 } | |
1399 } | |
1400 } | |
1401 } |