Mercurial > mm7
annotate mm7_6.cpp @ 2303:0a14fc2d121e
mm7_6.cpp include cleanup
author | Grumpy7 |
---|---|
date | Sun, 16 Mar 2014 21:04:00 +0100 |
parents | df24d11208df |
children | 9551756f46c4 |
rev | line source |
---|---|
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2245
diff
changeset
|
1 #define _CRT_SECURE_NO_WARNINGS |
0 | 2 #include "MM7.h" |
3 | |
1323 | 4 #include "Weather.h" |
1016 | 5 #include "Sprites.h" |
6 #include "Mouse.h" | |
7 #include "Keyboard.h" | |
8 | |
9 #include "Vis.h" | |
0 | 10 #include "Game.h" |
11 #include "GUIWindow.h" | |
12 #include "Party.h" | |
13 #include "AudioPlayer.h" | |
14 #include "Outdoor.h" | |
15 #include "Actor.h" | |
16 #include "Viewport.h" | |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
1989
diff
changeset
|
17 #include "OurMath.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
18 #include "SpriteObject.h" |
0 | 19 #include "ObjectList.h" |
2044 | 20 #include "Timer.h" |
0 | 21 #include "IconFrameTable.h" |
22 #include "TurnEngine.h" | |
924 | 23 #include "CastSpellInfo.h" |
0 | 24 #include "stru298.h" |
25 | |
26 | |
27 | |
28 | |
29 | |
30 | |
31 | |
32 //----- (00427546) -------------------------------------------------------- | |
33 int stru319::_427546(int a2) | |
34 { | |
35 int result; // eax@2 | |
36 | |
37 if ( a2 >= 0 ) | |
38 { | |
39 if ( a2 >= 1 ) | |
40 result = (a2 >= 2) + 2; | |
41 else | |
42 result = 1; | |
43 } | |
44 else | |
45 { | |
46 result = 0; | |
47 } | |
48 return result; | |
49 } | |
50 | |
51 //----- (0042EB8D) -------------------------------------------------------- | |
437 | 52 void GUIMessageQueue::AddMessageImpl(UIMessageType msg, int param, unsigned int a4, const char *file, int line) |
0 | 53 { |
482 | 54 //Log::Warning(L"%s @ (%S %u)", UIMessage2String(msg), file, line); |
0 | 55 if (uNumMessages < 40) |
56 { | |
437 | 57 files[uNumMessages] = file; |
58 lines[uNumMessages] = line; | |
59 | |
0 | 60 pMessages[uNumMessages].eType = msg; |
61 pMessages[uNumMessages].param = param; | |
62 pMessages[uNumMessages++].field_8 = a4; | |
63 } | |
64 } | |
65 | |
66 //----- (0042EBDB) -------------------------------------------------------- | |
323 | 67 int stru193_math::Sin(int angle) |
0 | 68 { |
323 | 69 return Cos(angle - this->uIntegerHalfPi); |
0 | 70 } |
71 | |
72 //----- (0042ECB5) -------------------------------------------------------- | |
271 | 73 void _42ECB5_PlayerAttacksActor() |
0 | 74 { |
75 char *v5; // eax@8 | |
76 unsigned int v9; // ecx@21 | |
77 char *v11; // eax@26 | |
78 unsigned int v12; // eax@47 | |
79 SoundID v24; // [sp-4h] [bp-40h]@58 | |
80 | |
271 | 81 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); |
1980 | 82 Player* player = &pParty->pPlayers[uActiveCharacter - 1]; |
271 | 83 if (!player->CanAct()) |
84 return; | |
85 | |
1517 | 86 CastSpellInfoHelpers::_427D48(); |
295 | 87 //v3 = 0; |
271 | 88 if (pParty->Invisible()) |
89 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); | |
90 | |
91 //v31 = player->pEquipment.uBow; | |
92 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
|
93 if (bow_idx && player->pInventoryItemList[bow_idx - 1].IsBroken()) |
271 | 94 bow_idx = 0; |
95 | |
295 | 96 //v32 = 0; |
97 int wand_item_id = 0; | |
271 | 98 //v33 = 0; |
99 //v4 = v1->pEquipment.uMainHand; | |
100 int laser_weapon_item_id = 0; | |
101 | |
102 int main_hand_idx = player->pEquipment.uMainHand; | |
103 if (main_hand_idx) | |
0 | 104 { |
1980 | 105 ItemGen* item = &player->pInventoryItemList[main_hand_idx - 1]; |
112 | 106 //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
|
107 if (!item->IsBroken()) |
271 | 108 { |
109 //v28b = &v1->pInventoryItems[v4].uItemID; | |
110 //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
|
111 if (item->GetItemEquipType() == EQUIP_WAND) |
0 | 112 { |
295 | 113 if (item->uNumCharges <= 0) |
114 player->pEquipment.uMainHand = 0; // wand discharged - unequip | |
0 | 115 else |
295 | 116 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
0 | 117 } |
271 | 118 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
119 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); | |
0 | 120 } |
271 | 121 } |
122 | |
295 | 123 //v30 = 0; |
124 //v29 = 0; | |
125 //v28 = 0; | |
271 | 126 //v7 = pMouse->uPointingObjectID; |
127 | |
128 int target_pid = pMouse->uPointingObjectID; | |
848 | 129 int target_type = PID_TYPE(target_pid), |
130 target_id = PID_ID(target_pid); | |
271 | 131 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) |
132 { | |
133 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); | |
848 | 134 target_type = PID_TYPE(target_pid); |
135 target_id = PID_ID(target_pid); | |
271 | 136 } |
295 | 137 |
1980 | 138 Actor* actor = &pActors[target_id]; |
295 | 139 int actor_distance = 0; |
271 | 140 if (target_type == OBJECT_Actor) |
141 { | |
295 | 142 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
143 distance_y = actor->vPosition.y - pParty->vPosition.y, | |
144 distance_z = actor->vPosition.z - pParty->vPosition.z; | |
145 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; | |
146 if (actor_distance < 0) | |
147 actor_distance = 0; | |
148 } | |
149 | |
150 bool shooting_bow = false, | |
151 shotting_laser = false, | |
816 | 152 shooting_wand = false, |
153 melee_attack = false; | |
295 | 154 if (laser_weapon_item_id) |
155 { | |
156 shotting_laser = true; | |
490 | 157 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
295 | 158 } |
159 else if (wand_item_id) | |
160 { | |
161 shooting_wand = true; | |
162 | |
163 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
|
164 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItemList[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
295 | 165 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1340
diff
changeset
|
166 if (!--player->pInventoryItemList[main_hand_idx - 1].uNumCharges) |
295 | 167 player->pEquipment.uMainHand = 0; |
168 } | |
303 | 169 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
295 | 170 { |
816 | 171 melee_attack = true; |
172 | |
303 | 173 Vec3_int_ a3; |
174 a3.x = actor->vPosition.x - pParty->vPosition.x; | |
175 a3.y = actor->vPosition.y - pParty->vPosition.y; | |
176 a3.z = actor->vPosition.z - pParty->vPosition.z; | |
177 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); | |
178 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
179 DamageMonsterFromParty(PID(OBJECT_Player, uActiveCharacter - 1), target_id, &a3); |
1989 | 180 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_TWO_HANDED) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_SINGLE_HANDED)) |
2114 | 181 _42FA66_do_explosive_impact(actor->vPosition.x, actor->vPosition.y, actor->vPosition.z + actor->uActorHeight / 2, 0, 512, uActiveCharacter); |
303 | 182 } |
183 else if (bow_idx) | |
184 { | |
185 shooting_bow = true; | |
490 | 186 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
295 | 187 } |
188 else | |
189 { | |
816 | 190 melee_attack = true; |
303 | 191 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
192 } | |
193 | |
816 | 194 if (!pParty->bTurnBasedModeOn && melee_attack) // wands, bows & lasers will add recovery while shooting spell effect |
303 | 195 { |
816 | 196 int recovery = player->GetAttackRecoveryTime(false); |
303 | 197 if (recovery < 30 ) |
198 recovery = 30; | |
816 | 199 player->SetRecoveryTime(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333); |
295 | 200 } |
201 | |
202 int v34 = 0; | |
203 if (shooting_wand) | |
204 return; | |
205 else if (shooting_bow) | |
206 { | |
207 v34 = 5; | |
208 player->PlaySound(SPEECH_50, 0); | |
209 } | |
210 if (shotting_laser) | |
211 v34 = 7; | |
212 else | |
213 { | |
214 int main_hand_idx = player->pEquipment.uMainHand; | |
1989 | 215 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1685
diff
changeset
|
216 v34 = player->pInventoryItemList[main_hand_idx - 1].GetPlayerSkillType(); |
1448 | 217 pTurnEngine->ApplyPlayerAction(); |
295 | 218 } |
219 | |
220 switch (v34) | |
221 { | |
222 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; | |
223 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; | |
224 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; | |
225 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; | |
226 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; | |
227 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; | |
228 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; | |
229 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; | |
230 } | |
0 | 231 } |
232 | |
233 //----- (0042F184) -------------------------------------------------------- | |
295 | 234 int stru319::FindClosestActor(int pick_depth, int a3, int a4) |
0 | 235 { |
236 int v4; // edi@1 | |
237 stru319 *v5; // esi@1 | |
238 int v6; // eax@2 | |
239 int v7; // eax@4 | |
240 int result; // eax@5 | |
241 int *v9; // edx@8 | |
242 signed int v10; // ebx@10 | |
243 int v11; // edi@11 | |
2117 | 244 //Actor *v12; // esi@12 |
245 //unsigned __int16 v13; // ax@12 | |
0 | 246 int v14; // eax@22 |
2117 | 247 //char v15; // zf@30 |
0 | 248 int v16; // esi@32 |
249 int v17; // ecx@34 | |
250 stru319 *v18; // eax@39 | |
251 int v19; // edx@39 | |
252 int v20; // ecx@41 | |
253 unsigned __int16 v21; // ax@42 | |
254 unsigned int v22; // [sp+8h] [bp-24h]@11 | |
2117 | 255 //unsigned int v23; // [sp+Ch] [bp-20h]@7 |
0 | 256 stru319 *v24; // [sp+10h] [bp-1Ch]@1 |
257 unsigned int v25; // [sp+14h] [bp-18h]@8 | |
258 int *v26; // [sp+18h] [bp-14h]@8 | |
259 int v27; // [sp+1Ch] [bp-10h]@10 | |
260 int *v28; // [sp+20h] [bp-Ch]@10 | |
2117 | 261 //unsigned int v29; // [sp+24h] [bp-8h]@7 |
0 | 262 int v30; // [sp+28h] [bp-4h]@6 |
263 int i; // [sp+38h] [bp+Ch]@33 | |
264 signed int v32; // [sp+3Ch] [bp+10h]@32 | |
265 | |
266 v4 = 0; | |
267 v5 = this; | |
268 v24 = this; | |
2153 | 269 //if ( pRenderer->pRenderD3D ) |
0 | 270 { |
271 v6 = a3 != 0; | |
272 if ( a4 ) | |
273 LOBYTE(v6) = v6 | 8; | |
295 | 274 v7 = pGame->pVisInstance->PickClosestActor(OBJECT_Actor, pick_depth, v6, 657456, -1); |
0 | 275 if ( v7 != -1 ) |
276 return (unsigned __int16)v7; | |
295 | 277 else return 0; |
0 | 278 } |
2153 | 279 /*else // software impl |
0 | 280 { |
281 v30 = 0; | |
282 if ( pRenderer->pActiveZBuffer ) | |
283 { | |
692 | 284 if ( (signed int)viewparams->uScreen_topL_Y < (signed int)viewparams->uScreen_BttmR_Y ) |
0 | 285 { |
692 | 286 v9 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y]; |
287 v26 = &pRenderer->pActiveZBuffer[viewparams->uScreen_topL_X + 640 * viewparams->uScreen_topL_Y]; | |
2117 | 288 for ( v25 = viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y; v25; --v25 ) |
0 | 289 { |
2117 | 290 if ( (signed int)viewparams->uScreen_topL_X < (signed int)viewparams->uScreen_BttmR_X ) |
0 | 291 { |
292 v28 = v9; | |
293 v10 = v4; | |
2117 | 294 for ( v27 = viewparams->uScreen_BttmR_X - viewparams->uScreen_topL_X; v27; --v27 ) |
0 | 295 { |
296 v22 = *v28; | |
297 v11 = *v28 & 0xFFFF; | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
298 if (PID_TYPE(v11) == OBJECT_Actor) |
0 | 299 { |
2117 | 300 if ( pActors[PID_ID(v11)].uAIState != Dead ) |
0 | 301 { |
2117 | 302 if ( pActors[PID_ID(v11)].uAIState != Dying && pActors[PID_ID(v11)].uAIState != Removed |
303 && pActors[PID_ID(v11)].uAIState != Summoned && pActors[PID_ID(v11)].uAIState != Disabled | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
304 && (!a3 || pActors[PID_ID(v11)].GetActorsRelation(0)) ) |
0 | 305 { |
2117 | 306 if ( (!a4 || MonsterStats::BelongsToSupertype(pActors[PID_ID(v11)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) |
295 | 307 && v22 <= pick_depth << 16 ) |
0 | 308 { |
309 v14 = 0; | |
310 if ( v10 > 0 ) | |
311 { | |
2117 | 312 for ( v14; v14 < v30; ++v14 ) |
0 | 313 { |
314 if ( dword_50BDA0[v14] == v11 ) | |
315 break; | |
316 } | |
317 } | |
318 if ( v14 == v30 && v10 < 100 ) | |
319 { | |
320 ++v30; | |
321 dword_50BC10[v10] = v22; | |
322 dword_50BDA0[v10] = v11; | |
323 ++v10; | |
324 } | |
325 } | |
326 } | |
327 } | |
328 } | |
329 ++v28; | |
330 } | |
331 v4 = v30; | |
332 v5 = v24; | |
333 } | |
334 v9 = v26 + 640; | |
335 v26 += 640; | |
336 } | |
337 } | |
338 if ( v4 > 0 ) | |
339 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
340 v16 = (int)dword_50BC10.data(); |
2117 | 341 for ( v32 = 1; v32 - 1 < v4; ++v32 ) |
0 | 342 { |
343 for ( i = v32; i < v4; ++i ) | |
344 { | |
345 v17 = dword_50BC10[i]; | |
2117 | 346 if ( dword_50BC10[i] < *(int *)v16 ) |
0 | 347 { |
348 dword_50BC10[i] = *(int *)v16; | |
349 *(int *)v16 = v17; | |
350 } | |
351 } | |
352 v16 += 4; | |
353 } | |
354 v5 = v24; | |
355 if ( v4 > 0 ) | |
356 { | |
357 v18 = v24; | |
2117 | 358 for ( v19 = v4; v19; --v19 ) |
0 | 359 { |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1202
diff
changeset
|
360 *(int *)&v18->field_0 = (*(int *)&v18[(char *)dword_50BC10.data() - (char *)v24].field_0 >> 3) & 0x1FFF; |
0 | 361 v18 += 4; |
362 } | |
363 } | |
364 } | |
365 v20 = 0; | |
366 for ( *(int *)&v5[2000].field_0 = v4; v20 < v4; ++v20 ) | |
367 { | |
368 v21 = pActors[*(int *)&v5[4 * v20].field_0].uAIState; | |
369 if ( v21 != 4 && v21 != 5 ) | |
370 break; | |
371 } | |
372 if ( v20 != v4 ) | |
373 { | |
374 result = 8 * *(int *)&v5[4 * v20].field_0; | |
375 LOBYTE(result) = result | 3; | |
376 return result; | |
377 } | |
378 } | |
379 } | |
2153 | 380 return 0;*/ |
0 | 381 } |
382 | |
383 //----- (0042F3D6) -------------------------------------------------------- | |
384 void InitializeTurnBasedAnimations(void *_this) | |
385 { | |
2153 | 386 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i) |
387 { | |
388 char icon_name[32]; | |
389 sprintf(icon_name, "turn%u", i); | |
2242 | 390 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name); |
2153 | 391 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]); |
392 } | |
0 | 393 |
394 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); | |
395 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); | |
396 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); | |
397 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); | |
398 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); | |
2153 | 399 |
0 | 400 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); |
401 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); | |
402 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); | |
403 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); | |
404 } | |
405 | |
406 //----- (0042F7EB) -------------------------------------------------------- | |
407 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) | |
408 { | |
1406 | 409 unsigned __int16 pObjectDescID; // ax@7 |
410 SpriteObject pSpellObject; // [sp+Ch] [bp-78h]@1 | |
0 | 411 |
1406 | 412 pSpellObject.stru_24.Reset(); |
0 | 413 if ( a9 ) |
1406 | 414 memcpy(&pSpellObject.stru_24, a9, sizeof(pSpellObject.stru_24)); |
415 pSpellObject.spell_skill = 0; | |
416 pSpellObject.spell_level = 0; | |
417 pSpellObject.spell_id = 0; | |
418 pSpellObject.field_54 = 0; | |
419 pSpellObject.uType = uSpriteID; | |
2114 | 420 pObjectDescID = 0; |
421 for ( uint i = 0; i < (signed int)pObjectList->uNumObjects; ++i ) | |
0 | 422 { |
2114 | 423 if ( (short)uSpriteID == pObjectList->pObjects[i].uObjectID ) |
424 pObjectDescID = i; | |
0 | 425 } |
1406 | 426 pSpellObject.uObjectDescID = pObjectDescID; |
427 pSpellObject.vPosition.x = x; | |
428 pSpellObject.vPosition.y = y; | |
429 pSpellObject.vPosition.z = z; | |
430 pSpellObject.uSoundID = 0; | |
431 pSpellObject.uAttributes = attributes; | |
432 pSpellObject.uSectorID = pIndoor->GetSector(x, y, z); | |
433 pSpellObject.uSpriteFrameID = 0; | |
434 pSpellObject.spell_caster_pid = 0; | |
435 pSpellObject.spell_target_pid = 0; | |
436 if ( !(pSpellObject.uAttributes & 0x10) ) | |
437 { | |
438 if ( pItemsTable->uAllItemsCount ) | |
439 { | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1709
diff
changeset
|
440 for ( uint i = 1; i < pItemsTable->uAllItemsCount; ++i ) |
1406 | 441 { |
442 if ( pItemsTable->pItems[i].uSpriteID == uSpriteID ) | |
443 pSpellObject.stru_24.uItemID = i; | |
444 } | |
445 } | |
446 } | |
0 | 447 if ( a7 ) |
448 { | |
449 if ( count > 0 ) | |
450 { | |
1406 | 451 for ( uint i = count; i; --i ) |
0 | 452 { |
1406 | 453 pSpellObject.uFacing = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; |
454 pSpellObject.Create((signed __int16)pSpellObject.uFacing, | |
455 ((signed int)stru_5C6E00->uIntegerHalfPi / 2) + (rand() % ((signed int)stru_5C6E00->uIntegerHalfPi / 2)), a4, 0); | |
456 | |
0 | 457 } |
458 } | |
459 } | |
460 else | |
461 { | |
1406 | 462 pSpellObject.uFacing = 0; |
0 | 463 if ( count > 0 ) |
464 { | |
1406 | 465 for ( uint i = count; i; --i ) |
0 | 466 { |
1406 | 467 pSpellObject.Create((signed __int16)pSpellObject.uFacing, stru_5C6E00->uIntegerHalfPi, a4, 0); |
0 | 468 } |
469 } | |
470 } | |
1406 | 471 return true; |
0 | 472 } |
473 | |
474 //----- (0042F960) -------------------------------------------------------- | |
475 void __fastcall sub_42F960_create_object(int x, int y, int z) | |
476 { | |
477 unsigned __int16 v7; // ax@5 | |
478 signed int v8; // eax@6 | |
479 signed int v9; // eax@7 | |
480 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
481 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
|
482 //SpriteObject::SpriteObject(&a1); |
0 | 483 a1.stru_24.Reset(); |
484 | |
822 | 485 a1.spell_skill = 0; |
486 a1.spell_level = 0; | |
487 a1.spell_id = 0; | |
0 | 488 a1.field_54 = 0; |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
489 a1.uType = 800; |
2114 | 490 v7 = 0; |
491 for ( uint i = 0; i < (signed int)pObjectList->uNumObjects; ++i ) | |
0 | 492 { |
2114 | 493 if ( a1.uType == pObjectList->pObjects[i].uObjectID ) |
494 v7 = i; | |
0 | 495 } |
496 a1.uObjectDescID = v7; | |
2114 | 497 a1.vPosition.x = x; |
498 a1.vPosition.y = y; | |
0 | 499 a1.vPosition.z = z; |
500 a1.uSoundID = 0; | |
501 a1.uAttributes = 0; | |
2114 | 502 a1.uSectorID = pIndoor->GetSector(x, y, z); |
0 | 503 a1.uSpriteFrameID = 0; |
822 | 504 a1.spell_caster_pid = 0; |
823 | 505 a1.spell_target_pid = 0; |
0 | 506 v8 = a1.Create(0, 0, 0, 0); |
507 if ( v8 != -1 ) | |
508 { | |
509 v9 = 8 * v8; | |
510 LOBYTE(v9) = v9 | 2; | |
511 pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|0x14), v9, 0, -1, 0, 0, 0, 0); | |
512 } | |
513 } | |
514 | |
515 //----- (0042FA66) -------------------------------------------------------- | |
1546 | 516 void _42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) |
0 | 517 { |
518 unsigned __int16 v9; // ax@5 | |
519 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
520 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
|
521 //SpriteObject::SpriteObject(&a1a); |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
490
diff
changeset
|
522 a1a.uType = 600; |
0 | 523 a1a.stru_24.Reset(); |
524 | |
822 | 525 a1a.spell_id = SPELL_FIRE_FIREBALL; |
526 a1a.spell_level = 8; | |
527 a1a.spell_skill = 3; | |
2114 | 528 v9 = 0; |
529 for ( uint i = 0; i < pObjectList->uNumObjects; ++i ) | |
0 | 530 { |
2114 | 531 if ( a1a.uType == pObjectList->pObjects[i].uObjectID ) |
532 v9 = i; | |
0 | 533 } |
534 a1a.uObjectDescID = v9; | |
2114 | 535 a1a.vPosition.x = a1; |
536 a1a.vPosition.y = a2; | |
0 | 537 a1a.vPosition.z = a3; |
538 a1a.uAttributes = 0; | |
2114 | 539 a1a.uSectorID = pIndoor->GetSector(a1, a2, a3); |
0 | 540 a1a.uSpriteFrameID = 0; |
823 | 541 a1a.spell_target_pid = 0; |
0 | 542 a1a.field_60_distance_related_prolly_lod = 0; |
543 a1a.uFacing = 0; | |
544 a1a.uSoundID = 0; | |
545 if ( a6 >= 1 || a6 <= 4 ) | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
824
diff
changeset
|
546 a1a.spell_caster_pid = PID(OBJECT_Player, a6 - 1); |
0 | 547 else |
822 | 548 a1a.spell_caster_pid = 0; |
1546 | 549 |
550 int id = a1a.Create(0, 0, 0, 0); | |
551 if (id != -1) | |
2059 | 552 AttackerInfo.Add(PID(OBJECT_Item, id), a5, SLOWORD(a1a.vPosition.x), SLOWORD(a1a.vPosition.y), |
2057 | 553 SLOWORD(a1a.vPosition.z), 0, 0); |
0 | 554 } |
555 | |
556 //----- (0042FBDD) -------------------------------------------------------- | |
1458 | 557 void sub_42FBDD() |
0 | 558 { |
388 | 559 pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); |
0 | 560 pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]); |
561 pRenderer->Present(); | |
562 } | |
563 | |
564 //----- (0042FC15) -------------------------------------------------------- | |
1458 | 565 void CloseWindowBackground() |
0 | 566 { |
388 | 567 pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0); |
0 | 568 pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]); |
569 pRenderer->Present(); | |
570 } | |
571 | |
572 //----- (0042FC4E) -------------------------------------------------------- | |
1575 | 573 void ProcessInputActions() |
0 | 574 { |
575 char v4; // al@9 | |
2114 | 576 //char v8; // bl@100 |
0 | 577 unsigned __int16 v9; // ax@102 |
2114 | 578 int spell_price; // eax@103 |
0 | 579 char v14; // al@159 |
580 unsigned int v15; // eax@168 | |
581 PartyAction partyAction; // [sp-14h] [bp-1Ch]@20 | |
582 InputAction inputAction; // [sp+0h] [bp-8h]@7 | |
2114 | 583 //int v24; // [sp+4h] [bp-4h]@87 |
0 | 584 |
585 pGame->pKeyboardInstance->EnterCriticalSection(); | |
1980 | 586 Keyboard* pKeyboard = pGame->pKeyboardInstance; |
0 | 587 if (!bAlwaysRun) |
588 { | |
589 if (pKeyboard->IsShiftHeld()) | |
590 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
591 else | |
592 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
593 } | |
594 else | |
595 { | |
596 if (pKeyboard->IsShiftHeld()) | |
597 pParty->uFlags2 &= ~PARTY_FLAGS_2_RUNNING; | |
598 else | |
599 pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; | |
600 } | |
601 | |
140 | 602 //pParty->uFlags2 |= PARTY_FLAGS_2_RUNNING; |
1052 | 603 |
604 | |
605 // WUT? double event trigger | |
606 /*for ( uint i = 0; i < 30; ++i ) | |
998 | 607 { |
608 if ( pKeyActionMap->pToggleTypes[i] ) | |
609 v14 = pGame->pKeyboardInstance->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[i]); | |
610 else | |
611 v14 = pGame->pKeyboardInstance->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[i]); | |
1052 | 612 if ( v14 ) |
998 | 613 { |
1052 | 614 if (pCurrentScreen == SCREEN_GAME) |
998 | 615 { |
616 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); | |
617 continue; | |
618 } | |
619 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
620 { | |
621 v15 = pMessageQueue_50CBD0->uNumMessages; | |
622 if ( pMessageQueue_50CBD0->uNumMessages ) | |
623 { | |
624 v15 = 0; | |
625 if ( pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 ) | |
626 { | |
627 v15 = 1; | |
628 pMessageQueue_50CBD0->uNumMessages = 0; | |
629 pMessageQueue_50CBD0->pMessages[v15].eType = UIMSG_Escape; | |
630 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
631 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
632 ++pMessageQueue_50CBD0->uNumMessages; | |
633 continue; | |
634 } | |
635 pMessageQueue_50CBD0->uNumMessages = 0; | |
636 } | |
637 //pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
638 } | |
639 } | |
1052 | 640 }*/ |
0 | 641 if ( !pEventTimer->bPaused ) |
642 { | |
998 | 643 for ( uint i = 0; i < 30; ++i ) |
0 | 644 { |
998 | 645 inputAction = (InputAction)i; |
2201 | 646 if ( pKeyActionMap->pToggleTypes[inputAction] ) |
647 v4 = pKeyboard->WasKeyPressed(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]); | |
0 | 648 else |
2201 | 649 v4 = pKeyboard->IsKeyBeingHeld(pKeyActionMap->pVirtualKeyCodesMapping[inputAction]); |
0 | 650 if ( v4 ) |
651 { | |
652 switch ( inputAction ) | |
653 { | |
654 case INPUT_MoveForward: | |
271 | 655 if (pCurrentScreen != SCREEN_GAME) |
0 | 656 break; |
657 if (!pParty->bTurnBasedModeOn) | |
658 { | |
140 | 659 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) |
0 | 660 partyAction = PARTY_RunForward; |
661 else | |
662 partyAction = PARTY_WalkForward; | |
998 | 663 pPartyActionQueue->Add(partyAction); |
163 | 664 break; |
665 } | |
2242 | 666 if (pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 ) |
163 | 667 { |
668 pTurnEngine->uActionPointsLeft -= 26; | |
669 if ( pParty->uFlags2 & PARTY_FLAGS_2_RUNNING) | |
670 partyAction = PARTY_RunForward; | |
671 else | |
672 partyAction = PARTY_WalkForward; | |
998 | 673 pPartyActionQueue->Add(partyAction); |
163 | 674 break; |
0 | 675 } |
676 break; | |
677 case INPUT_MoveBackwards: | |
271 | 678 if (pCurrentScreen != SCREEN_GAME) |
0 | 679 break; |
680 if (!pParty->bTurnBasedModeOn) | |
17 | 681 { |
682 if ( pParty->uFlags2 & 2 ) | |
683 partyAction = PARTY_RunBackward; | |
684 else | |
685 partyAction = PARTY_WalkBackward; | |
998 | 686 pPartyActionQueue->Add(partyAction); |
163 | 687 break; |
17 | 688 } |
2242 | 689 if ( pTurnEngine->turn_stage != TE_WAIT && pTurnEngine->turn_stage != TE_ATTACK && pTurnEngine->uActionPointsLeft > 0 ) |
0 | 690 { |
691 pTurnEngine->uActionPointsLeft -= 26; | |
692 if ( pParty->uFlags2 & 2 ) | |
693 partyAction = PARTY_RunBackward; | |
694 else | |
695 partyAction = PARTY_WalkBackward; | |
998 | 696 pPartyActionQueue->Add(partyAction); |
163 | 697 break; |
0 | 698 } |
699 break; | |
700 case INPUT_StrafeLeft: | |
271 | 701 if (pCurrentScreen != SCREEN_GAME) |
0 | 702 break; |
703 if (!pParty->bTurnBasedModeOn) | |
17 | 704 { |
705 partyAction = PARTY_StrafeLeft; | |
998 | 706 pPartyActionQueue->Add(partyAction); |
163 | 707 break; |
17 | 708 } |
2242 | 709 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 710 break; |
711 pTurnEngine->uActionPointsLeft -= 26; | |
712 partyAction = PARTY_StrafeLeft; | |
998 | 713 pPartyActionQueue->Add(partyAction); |
714 break; | |
0 | 715 case INPUT_StrafeRight: |
271 | 716 if (pCurrentScreen != SCREEN_GAME) |
0 | 717 break; |
718 if (!pParty->bTurnBasedModeOn) | |
17 | 719 { |
720 partyAction = PARTY_StrafeRight; | |
998 | 721 pPartyActionQueue->Add(partyAction); |
163 | 722 break; |
17 | 723 } |
2242 | 724 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 725 break; |
726 pTurnEngine->uActionPointsLeft -= 26; | |
727 partyAction = PARTY_StrafeRight; | |
998 | 728 pPartyActionQueue->Add(partyAction); |
163 | 729 break; |
0 | 730 case INPUT_TurnLeft: |
271 | 731 if (pCurrentScreen != SCREEN_GAME) |
0 | 732 break; |
733 if ( GetAsyncKeyState(VK_CONTROL) ) // strafing | |
734 { | |
735 if (pParty->bTurnBasedModeOn) | |
736 { | |
2242 | 737 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 738 break; |
739 pTurnEngine->uActionPointsLeft -= 26; | |
740 } | |
998 | 741 partyAction = PARTY_StrafeLeft; |
0 | 742 } |
743 else | |
744 { | |
745 if ( pParty->uFlags2 & 2 ) | |
998 | 746 partyAction = PARTY_FastTurnLeft; |
0 | 747 else |
998 | 748 partyAction = PARTY_TurnLeft; |
0 | 749 } |
998 | 750 pPartyActionQueue->Add(partyAction); |
0 | 751 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) |
271 | 752 pWeather->OnPlayerTurn(10); |
0 | 753 break; |
754 case INPUT_TurnRight: | |
271 | 755 if (pCurrentScreen != SCREEN_GAME) |
0 | 756 break; |
757 if ( GetAsyncKeyState(17) ) // strafing | |
758 { | |
759 if (pParty->bTurnBasedModeOn) | |
760 { | |
2242 | 761 if ( pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_ATTACK || pTurnEngine->uActionPointsLeft <= 0 ) |
0 | 762 break; |
763 pTurnEngine->uActionPointsLeft -= 26; | |
764 } | |
998 | 765 partyAction = PARTY_StrafeRight; |
0 | 766 } |
767 else | |
768 { | |
769 if ( pParty->uFlags2 & 2 ) | |
998 | 770 partyAction = PARTY_FastTurnRight; |
0 | 771 else |
998 | 772 partyAction = PARTY_TurnRight; |
0 | 773 } |
998 | 774 pPartyActionQueue->Add(partyAction); |
0 | 775 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor && pWeather->bRenderSnow) |
271 | 776 pWeather->OnPlayerTurn(-10); |
0 | 777 break; |
778 case INPUT_Jump: | |
271 | 779 if (pCurrentScreen != SCREEN_GAME || pParty->bTurnBasedModeOn) |
0 | 780 break; |
781 partyAction = (PartyAction)12; | |
998 | 782 pPartyActionQueue->Add(partyAction); |
163 | 783 break; |
0 | 784 case INPUT_Yell: |
187 | 785 if (!pCurrentScreen && uActiveCharacter) |
0 | 786 { |
787 pParty->Yell(); | |
187 | 788 pPlayers[uActiveCharacter]->PlaySound(SPEECH_Yell, 0); |
0 | 789 } |
187 | 790 break; |
0 | 791 case INPUT_Pass: |
792 if ( pCurrentScreen ) | |
793 break; | |
2242 | 794 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT) |
17 | 795 { |
1332 | 796 pTurnEngine->field_18 |= TE_FLAG_8; |
17 | 797 break; |
798 } | |
0 | 799 if ( uActiveCharacter ) |
800 { | |
998 | 801 if ( !pPlayers[uActiveCharacter]->uTimeToRecovery ) |
0 | 802 { |
803 if ( !pParty->bTurnBasedModeOn ) | |
2114 | 804 pPlayers[uActiveCharacter]->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)pPlayers[uActiveCharacter]->GetAttackRecoveryTime(false) * 2.133333333333333)); |
1517 | 805 CastSpellInfoHelpers::_427D48(); |
1448 | 806 pTurnEngine->ApplyPlayerAction(); |
0 | 807 } |
808 } | |
809 break; | |
998 | 810 case INPUT_Combat://if press ENTER |
271 | 811 if (pCurrentScreen == SCREEN_GAME) |
0 | 812 { |
813 if (pParty->bTurnBasedModeOn) | |
814 { | |
2242 | 815 if (pTurnEngine->turn_stage == TE_MOVEMENT || PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) |
0 | 816 { |
817 pParty->bTurnBasedModeOn = 0; | |
818 pTurnEngine->End(true); | |
819 } | |
820 } | |
821 else | |
822 { | |
823 pTurnEngine->Start(); | |
824 pParty->bTurnBasedModeOn = true; | |
825 } | |
826 } | |
827 break; | |
828 case INPUT_CastReady: | |
271 | 829 if (pCurrentScreen != SCREEN_GAME) |
0 | 830 break; |
2242 | 831 if (pParty->bTurnBasedModeOn && pTurnEngine->turn_stage == TE_MOVEMENT) |
17 | 832 { |
1332 | 833 pTurnEngine->field_18 |= TE_FLAG_8; |
17 | 834 break; |
835 } | |
0 | 836 if ( !uActiveCharacter ) |
837 break; | |
2114 | 838 v9 = pPlayers[uActiveCharacter]->pActiveSkills[(unsigned __int8)pPlayers[uActiveCharacter]->uQuickSpell / 11 + 12]; |
839 if ( !pPlayers[uActiveCharacter]->uQuickSpell || bUnderwater | |
840 || (( !(HIBYTE(v9) & 1)) ? | |
841 ((v9 & 0x80) == 0 ? | |
842 ((v9 & 0x40) == 0 ? spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uNormalLevelMana : spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uExpertLevelMana) : | |
843 spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uMasterLevelMana) : | |
844 spell_price = pSpellDatas[pPlayers[uActiveCharacter]->uQuickSpell].uMagisterLevelMana, | |
845 spell_price > pPlayers[uActiveCharacter]->sMana) ) | |
0 | 846 { |
998 | 847 pPartyActionQueue = pPartyActionQueue; |
437 | 848 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); |
849 break; | |
0 | 850 } |
851 else | |
2114 | 852 pMessageQueue_50C9E8->AddMessage(UIMSG_CastQuickSpell, 0, 0); |
0 | 853 break; |
854 case INPUT_Attack: | |
271 | 855 if (pCurrentScreen != SCREEN_GAME) |
0 | 856 break; |
2242 | 857 if (pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT) |
998 | 858 { |
1332 | 859 pTurnEngine->field_18 |= TE_FLAG_8; |
998 | 860 break; |
861 } | |
862 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); | |
0 | 863 break; |
864 case INPUT_EventTrigger: | |
271 | 865 if (pCurrentScreen == SCREEN_GAME) |
0 | 866 { |
437 | 867 pMessageQueue_50CBD0->AddMessage(UIMSG_Game_Action, 0, 0); |
163 | 868 break; |
0 | 869 } |
151 | 870 if ( pCurrentScreen == SCREEN_NPC_DIALOGUE ) |
0 | 871 { |
872 if ( pMessageQueue_50CBD0->uNumMessages ) | |
873 { | |
437 | 874 pMessageQueue_50CBD0->uNumMessages = 0; |
0 | 875 if ( pMessageQueue_50CBD0->pMessages[0].field_8 ) |
876 { | |
877 pMessageQueue_50CBD0->uNumMessages = 1; | |
998 | 878 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 879 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; |
1575 | 880 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].field_8 = 0; |
0 | 881 ++pMessageQueue_50CBD0->uNumMessages; |
882 break; | |
883 } | |
437 | 884 break; |
0 | 885 } |
437 | 886 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
0 | 887 } |
888 break; | |
889 case INPUT_CharCycle: | |
1012 | 890 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) |
0 | 891 break; |
1575 | 892 |
1012 | 893 pMessageQueue_50C9E8->AddMessage(UIMSG_CycleCharacters, 0, 0); |
163 | 894 break; |
0 | 895 case INPUT_LookUp: |
896 if ( pEventTimer->bPaused ) | |
897 break; | |
898 partyAction = (PartyAction)7; | |
998 | 899 pPartyActionQueue->Add(partyAction); |
163 | 900 break; |
0 | 901 case INPUT_CenterView: |
902 if ( pEventTimer->bPaused ) | |
903 break; | |
904 partyAction = (PartyAction)9; | |
998 | 905 pPartyActionQueue->Add(partyAction); |
163 | 906 break; |
0 | 907 case INPUT_LookDown: |
908 if ( pEventTimer->bPaused ) | |
909 break; | |
910 partyAction = (PartyAction)8; | |
998 | 911 pPartyActionQueue->Add(partyAction); |
163 | 912 break; |
0 | 913 case INPUT_FlyUp: |
998 | 914 if ( pCurrentScreen || pEventTimer->bPaused ) |
0 | 915 break; |
916 partyAction = (PartyAction)13; | |
998 | 917 pPartyActionQueue->Add(partyAction); |
163 | 918 break; |
0 | 919 case INPUT_Land: |
998 | 920 if ( pCurrentScreen || pEventTimer->bPaused ) |
0 | 921 break; |
922 partyAction = (PartyAction)15; | |
998 | 923 pPartyActionQueue->Add(partyAction); |
163 | 924 break; |
0 | 925 case INPUT_FlyDown: |
926 if ( !pCurrentScreen | |
927 && !pEventTimer->bPaused ) | |
928 { | |
929 partyAction = (PartyAction)14; | |
998 | 930 pPartyActionQueue->Add(partyAction); |
0 | 931 } |
932 break; | |
933 case INPUT_ZoomIn: | |
1012 | 934 pMessageQueue_50C9E8->AddMessage(UIMSG_ClickZoomOutBtn, 0, 0); |
163 | 935 break; |
0 | 936 case INPUT_ZoomOut: |
1012 | 937 pMessageQueue_50C9E8->AddMessage(UIMSG_ClickZoomInBtn, 0, 0); |
0 | 938 break; |
939 case INPUT_AlwaysRun: | |
940 bAlwaysRun = bAlwaysRun == 0; | |
941 break; | |
17 | 942 default: |
943 break; | |
0 | 944 } |
945 } | |
946 } | |
947 } | |
948 } |