annotate Game/Game.cpp @ 2564:f9bdfe26d03d

.
author a.parshin
date Wed, 20 May 2015 00:56:07 +0200
parents 65c97624c047
children 30eb6dcac768
rev   line source
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1 #include "Engine/Engine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2 #include "Engine/Party.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
3 #include "Engine/LOD.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
4 #include "Engine/Events.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
5 #include "Engine/Timer.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
6 #include "Engine/texts.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
7 #include "Engine/SaveLoad.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
8 #include "Engine/Registry.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
9 #include "Engine/Objects/Actor.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
10 #include "Engine/Objects/Chest.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
11 #include "Engine/Objects/ObjectList.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
12 #include "Engine/Objects/SpriteObject.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
13 #include "Engine/Graphics/IRender.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
14 #include "Engine/Graphics/Viewport.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
15 #include "Engine/Graphics/Outdoor.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
16 #include "Engine/Graphics/Overlays.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
17 #include "Engine/Graphics/Sprites.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
18 #include "Engine/Graphics/Vis.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
19 #include "Engine/Graphics/PaletteManager.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
20 #include "Engine/Graphics/DecalBuilder.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
21 #include "Engine/Graphics/Level/Decoration.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
22 #include "Engine/Tables/FrameTableInc.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
23 #include "Engine/TurnEngine/TurnEngine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
24 #include "Engine/Spells/CastSpellInfo.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
25
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
26 #include "IO/Keyboard.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
27 #include "IO/Mouse.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
28
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
29 #include "Arcomage/Arcomage.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
30
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
31 #include "Media/Audio/AudioPlayer.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
32 #include "Media/Audio/AIL.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
33
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
34 #include "GUI/GUIWindow.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
35 #include "GUI/GUIProgressBar.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
36 #include "GUI/UI/UIHouses.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
37 #include "GUI/UI/UIShops.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
38 #include "GUI/UI/UIPartyCreation.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
39 #include "GUI/UI/UIGame.h"
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
40 #include "GUI/UI/UICharacter.h"
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
41 #include "GUI/UI/UIQuickReference.h"
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
42 #include "GUI/UI/UISaveLoad.h"
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
43 #include "GUI/UI/UIModal.h"
2549
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
44 #include "GUI/UI/UIRest.h"
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
45 #include "GUI/UI/Spellbook.h"
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
46 #include "GUI/UI/UIBooks.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
47 #include "GUI/UI/Books/LloydsBook.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
48 #include "GUI/UI/Books/TownPortalBook.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
49 #include "GUI/UI/Books/QuestBook.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
50 #include "GUI/UI/Books/AutonotesBook.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
51 #include "GUI/UI/Books/MapBook.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
52 #include "GUI/UI/Books/CalendarBook.h"
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
53 #include "GUI/UI/Books/JournalBook.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
54
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
55 #include "Game/Game.h"
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
56 #include "Game/GameMenu.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
57
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
58
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
59 void DoThatMessageThing()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
60 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
61 if (pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
62 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
63 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
64
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
65
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
66
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
67 void Game_StartDialogue(unsigned int actor_id)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
68 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
69 if (uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
70 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
71 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
72
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
73 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
74
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
75 dword_5B65D0_dialogue_actor_npc_id = pActors[actor_id].sNPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
76 GameUI_InitializeDialogue(&pActors[actor_id], true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
77 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
78 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
79
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
80 void Game_StartHirelingDialogue(unsigned int hireling_id)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
81 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
82 if (bNoNPCHiring || current_screen_type != 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
83 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
84
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
85 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
86
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
87 uint hireling_slot = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
88 for (uint i = 0; i < 2; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
89 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
90 if (pParty->pHirelings[i].pName)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
91 pTmpBuf[hireling_slot++] = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
92 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
93
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
94 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
95 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
96 NPCData *npc = &pNPCStats->pNewNPCData[i];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
97 if (npc->Hired()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
98 && (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
99 && (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
100 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
101 pTmpBuf[hireling_slot++] = i + 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
102 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
103 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
104
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
105 if ((signed int)hireling_id + (signed int)pParty->hirelingScrollPosition < hireling_slot)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
106 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
107 Actor actor;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
108 memset(&actor, 0, sizeof(actor));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
109 actor.sNPC_ID += -1 - pParty->hirelingScrollPosition - hireling_id;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
110 GameUI_InitializeDialogue(&actor, true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
111 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
112 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
113
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
114
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
115
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
116 void Game_CloseTargetedSpellWindow()
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
117 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
118 if (pGUIWindow_CastTargetedSpell)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
119 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
120 if (current_screen_type == SCREEN_CHARACTERS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
121 pMouse->SetCursorBitmap("MICON2");
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
122 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
123 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
124 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
125 pGUIWindow_CastTargetedSpell = nullptr;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
126 pMouse->SetCursorBitmap("MICON1");
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
127 GameUI_Footer_TimeLeft = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
128 _50C9A0_IsEnchantingInProgress = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
129 back_to_game();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
130 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
131 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
132 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
133
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
134 void Game_OnEscape()
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
135 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
136 Game_CloseTargetedSpellWindow();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
137 if ((signed int)uActiveCharacter < 1 || (signed int)uActiveCharacter > 4)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
138 uActiveCharacter = pParty->GetNextActiveCharacter();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
139 pGUIWindow_CurrentMenu->Release();
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
140 if (pGUIWindow_CurrentMenu == window_SpeakInHouse)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
141 window_SpeakInHouse = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
142 pGUIWindow_CurrentMenu = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
143 pEventTimer->Resume();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
144 current_screen_type = SCREEN_GAME;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
145 viewparams->bRedrawGameUI = true;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
146 pIcons_LOD->RemoveTexturesFromTextureList();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
147 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
148
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
149
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
150
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
151 //----- (004304E7) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
152 void Game_EventLoop()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
153 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
154 unsigned int v2; // edx@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
155 Actor *pActor; // ecx@13
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
156 int v4; // ecx@18
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
157 unsigned int v10; // ecx@73
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
158 int v14; // eax@98
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
159 int v18; // eax@106
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
160 float v19; // ST64_4@121
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
161 float v21; // ST64_4@126
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
162 float v22; // ST64_4@127
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
163 unsigned int v24; // ecx@149
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
164 GUIWindow *pWindow2; // ecx@248
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
165 bool pKeyBindingFlag; // eax@269
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
166 unsigned int v33; // eax@277
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
167 int v37; // eax@341
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
168 int v38; // eax@358
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
169 SHORT v39; // ax@365
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
170 char *v41; // eax@380
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
171 int v42; // eax@396
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
172 signed int v44; // eax@398
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
173 int v45; // edx@398
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
174 signed int v46; // ecx@398
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
175 char v47; // zf@399
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
176 char v48; // zf@405
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
177 BLVFace *pBLVFace; // ecx@410
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
178 ODMFace *pODMFace; // ecx@412
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
179 CastSpellInfo *pSpellInfo; // ecx@415
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
180 __int16 v53; // ax@431
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
181 int v54; // eax@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
182 int v55; // ecx@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
183 int v56; // edx@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
184 int v57; // eax@432
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
185 Player *pPlayer; // edx@442
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
186 unsigned int pMapNum; // eax@445
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
187 signed int v60; // ST64_4@459
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
188 __int16 v63; // dx@479
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
189 unsigned int v64; // eax@486
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
190 int v65; // ecx@486
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
191 int v66; // eax@488
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
192 char *v67; // eax@489
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
193 __int16 v68; // dx@498
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
194 char *v69; // eax@512
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
195 int v70; // eax@525
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
196 int v71; // edi@527
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
197 NPCData *pNPCData3; // esi@527
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
198 char *v73; // ecx@533
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
199 signed int v74; // edi@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
200 int v75; // eax@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
201 int v76; // esi@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
202 int v77; // eax@537
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
203 Player *pPlayer2; // ecx@549
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
204 signed int v81; // eax@552
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
205 signed int v83; // ecx@554
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
206 signed int v84; // ecx@554
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
207 GUIButton *pButton; // eax@578
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
208 unsigned int v86; // eax@583
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
209 const char *v87; // ecx@595
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
210 const char *v88; // ecx@596
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
211 unsigned int v90; // eax@602
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
212 int v91; // edx@605
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
213 int v92; // eax@605
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
214 int v93; // edx@605
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
215 int pPlayerNum; // edx@611
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
216 int v95; // eax@611
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
217 unsigned int v97; // eax@624
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
218 int v98; // eax@636
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
219 int v103; // eax@671
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
220 Player *pPlayer4; // ecx@718
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
221 int v105; // eax@718
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
222 Player *pPlayer5; // ST78_4@758
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
223 unsigned int v107; // eax@758
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
224 unsigned int v108; // eax@758
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
225 unsigned int v115; // eax@764
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
226 int v116; // eax@776
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
227 unsigned int v118; // eax@785
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
228 unsigned int v119; // ecx@786
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
229 unsigned int v121; // [sp-28h] [bp-624h]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
230 unsigned int v123; // [sp-24h] [bp-620h]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
231 unsigned int v125; // [sp-20h] [bp-61Ch]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
232 int v127; // [sp-1Ch] [bp-618h]@107
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
233 unsigned int v128; // [sp-1Ch] [bp-618h]@711
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
234 GUIButton *pButton2; // [sp-4h] [bp-600h]@59
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
235 const char *v161; // [sp-4h] [bp-600h]@637
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
236 KeyToggleType pKeyToggleType; // [sp+0h] [bp-5FCh]@287
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
237 char *v173; // [sp+0h] [bp-5FCh]@444
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
238 char *v174; // [sp+0h] [bp-5FCh]@449
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
239 const char *v177; // [sp+0h] [bp-5FCh]@629
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
240 char *v178; // [sp+0h] [bp-5FCh]@637
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
241 signed int thisb; // [sp+14h] [bp-5E8h]@272
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
242 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
243 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
244 char *pMapName; // [sp+14h] [bp-5E8h]@445
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
245 Player *pPlayer9; // [sp+14h] [bp-5E8h]@455
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
246 int thisg; // [sp+14h] [bp-5E8h]@467
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
247 int thish; // [sp+14h] [bp-5E8h]@528
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
248 signed int thisi; // [sp+14h] [bp-5E8h]@535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
249 MapInfo *pMapInfo; // [sp+14h] [bp-5E8h]@604
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
250 Player *pPlayer10; // [sp+14h] [bp-5E8h]@641
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
251 int uMessageParam; // [sp+18h] [bp-5E4h]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
252 int uAction; // [sp+1Ch] [bp-5E0h]@18
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
253 NPCData *pNPCData4; // [sp+20h] [bp-5DCh]@23
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
254 unsigned int uNumSeconds; // [sp+24h] [bp-5D8h]@18
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
255 char v197; // [sp+2Bh] [bp-5D1h]@101
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
256 enum UIMessageType uMessage; // [sp+2Ch] [bp-5D0h]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
257 unsigned int v199; // [sp+30h] [bp-5CCh]@7
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
258 char *v200; // [sp+34h] [bp-5C8h]@518
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
259 POINT v202; // [sp+40h] [bp-5BCh]@141
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
260 POINT a2; // [sp+48h] [bp-5B4h]@127
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
261 POINT v205; // [sp+58h] [bp-5A4h]@171
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
262 POINT v207; // [sp+68h] [bp-594h]@155
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
263 POINT v211; // [sp+88h] [bp-574h]@704
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
264 int v213; // [sp+98h] [bp-564h]@385
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
265 char pLevelName[32]; // [sp+9Ch] [bp-560h]@380
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
266 char pOut[32]; // [sp+BCh] [bp-540h]@370
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
267 FrameTableTxtLine v216; // [sp+DCh] [bp-520h]@524
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
268 int v217[9]; // [sp+158h] [bp-4A4h]@652
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
269 FrameTableTxtLine v218; // [sp+17Ch] [bp-480h]@524
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
270 char a1[64]; // [sp+1F8h] [bp-404h]@467
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
271 char Str2[128]; // [sp+238h] [bp-3C4h]@527
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
272 Actor actor; // [sp+2B8h] [bp-344h]@4
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
273 int currHour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
274
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
275 dword_50CDC8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
276 if (!pEventTimer->bPaused)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
277 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
278 pParty->sEyelevel = pParty->uDefaultEyelevel;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
279 pParty->uPartyHeight = pParty->uDefaultPartyHeight;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
280 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
281 if (bDialogueUI_InitializeActor_NPC_ID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
282 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
283 //Actor::Actor(&actor);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
284 memset(&actor, 0, 0x344u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
285 dword_5B65D0_dialogue_actor_npc_id = bDialogueUI_InitializeActor_NPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
286 actor.sNPC_ID = bDialogueUI_InitializeActor_NPC_ID;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
287 GameUI_InitializeDialogue(&actor, false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
288 bDialogueUI_InitializeActor_NPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
289 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
290 if (pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
291 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
292 //v1 = "";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
293 while (2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
294 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
295 if (!pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
296 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
297
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
298 pMessageQueue_50CBD0->PopMessage(&uMessage, &uMessageParam, (int *)&v199);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
299 switch (uMessage)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
300 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
301 case UIMSG_ChangeGameState:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
302 uGameState = GAME_FINISHED;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
303 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
304 case UIMSG_PlayArcomage:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
305 BackToHouseMenu();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
306 pArcomageGame->bGameInProgress = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
307 ArcomageGame::PrepareArcomage();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
308 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
309
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
310 case UIMSG_StartNPCDialogue: Game_StartDialogue(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
311 case UIMSG_StartHireling1Dialogue:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
312 case UIMSG_StartHireling2Dialogue: Game_StartHirelingDialogue(uMessage - UIMSG_StartHireling1Dialogue); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
313 case UIMSG_BuyInShop_Identify_Repair: UIShop_Buy_Identify_Repair(); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
314 case UIMSG_ClickNPCTopic: ClickNPCTopic(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
315 case UIMSG_SelectShopDialogueOption: OnSelectShopDialogueOption(uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
316 case UIMSG_SelectNPCDialogueOption: OnSelectNPCDialogueOption((DIALOGUE_TYPE)uMessageParam); continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
317 case UIMSG_ClickHouseNPCPortrait: _4B4224_UpdateNPCTopics(uMessageParam); continue;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
318 //case UIMSG_StartNewGame: Game_StartNewGameWhilePlaying(uMessageParam); continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
319 //case UIMSG_Game_OpenLoadGameDialog: Game_OpenLoadGameDialog(); continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
320 //case UIMSG_Quit: Game_QuitGameWhilePlaying(uMessageParam); continue;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
321 case UIMSG_80:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
322 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
323 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
324 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
325 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
326 current_screen_type = SCREEN_OPTIONS;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
327 __debugbreak();//pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_8, 0, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
328 continue;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
329 /*case UIMSG_ArrowUp:
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
330 --pSaveListPosition;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
331 if (pSaveListPosition < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
332 pSaveListPosition = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
333 new OnButtonClick2(215, 199, 17, 17, (int)pBtnArrowUp, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
334 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
335 case UIMSG_DownArrow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
336 ++pSaveListPosition;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
337 if (pSaveListPosition >= uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
338 pSaveListPosition = uMessageParam - 1;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
339 new OnButtonClick2(215, 323, 17, 17, (int)pBtnDownArrow, 0);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
340 continue;*/
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
341 case UIMSG_Cancel:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
342 new OnCancel(350, 302, 106, 42, (int)pBtnCancel, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
343 continue;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
344 /*case UIMSG_SaveLoadBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
345 new OnSaveLoad(241, 302, 106, 42, (int)pBtnLoadSlot, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
346 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
347 case UIMSG_SelectLoadSlot:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
348 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
349 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
350 if (current_screen_type != SCREEN_SAVEGAME || uLoadGameUI_SelectedSlot != pSaveListPosition + uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
351 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
352 v10 = pSaveListPosition + uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
353 if (dword_6BE138 == pSaveListPosition + uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
354 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
355 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_SaveLoadBtn, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
356 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_LoadGame, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
357 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
358 uLoadGameUI_SelectedSlot = v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
359 dword_6BE138 = v10;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
360 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
361 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
362 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
363 pKeyActionMap->EnterText(0, 19, pGUIWindow_CurrentMenu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
364 if (strcmp(pSavegameHeader[uLoadGameUI_SelectedSlot].pName, pGlobalTXT_LocalizationStrings[72]))// "Empty"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
365 strcpy(pKeyActionMap->pPressedKeysBuffer, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
366 pKeyActionMap->uNumKeysPressed = strlen(pKeyActionMap->pPressedKeysBuffer);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
367 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
368 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
369 case UIMSG_LoadGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
370 if (pSavegameUsedSlots[uLoadGameUI_SelectedSlot])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
371 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
372 LoadGame(uLoadGameUI_SelectedSlot);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
373 uGameState = GAME_STATE_LOADING_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
374 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
375 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
376 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
377 case UIMSG_SaveGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
378 if (pGUIWindow_CurrentMenu->receives_keyboard_input_2 == WINDOW_INPUT_IN_PROGRESS)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
379 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
380 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_NONE);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
381 strcpy((char *)&pSavegameHeader[uLoadGameUI_SelectedSlot], pKeyActionMap->pPressedKeysBuffer);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
382 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
383 DoSavegame(uLoadGameUI_SelectedSlot);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
384 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
385 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
386 case UIMSG_Game_OpenSaveGameDialog:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
387 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
388 pGUIWindow_CurrentMenu->Release();
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
389
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
390 current_screen_type = SCREEN_SAVEGAME;
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
391 pGUIWindow_CurrentMenu = new GUIWindow_Save(); //SaveUI_Load(current_screen_type = SCREEN_SAVEGAME);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
392 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
393 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
394 case UIMSG_Game_OpenOptionsDialog://Open
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
395 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
396 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
397
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
398 pGUIWindow_CurrentMenu->Release();
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
399 pGUIWindow_CurrentMenu = new GUIWindow_GameOptions();//GameMenuUI_Options_Load();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
400
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
401 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
402 current_screen_type = SCREEN_OPTIONS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
403
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
404 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
405 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
406
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
407 case UIMSG_OpenKeyMappingOptions://Open
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
408 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
409 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
410
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
411 pGUIWindow_CurrentMenu->Release();
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
412 pGUIWindow_CurrentMenu = new GUIWindow_GameKeyBindings();//GameMenuUI_OptionsKeymapping_Load();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
413
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
414 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
415 current_screen_type = SCREEN_KEYBOARD_OPTIONS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
416
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
417 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
418 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
419
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
420 case UIMSG_ChangeKeyButton:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
421 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
422 if (uGameMenuUI_CurentlySelectedKeyIdx != -1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
423 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
424 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
425 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
426 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
427 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
428 uGameMenuUI_CurentlySelectedKeyIdx = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
429 if (KeyboardPageNum != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
430 uGameMenuUI_CurentlySelectedKeyIdx += 14;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
431 pKeyActionMap->EnterText(0, 1, pGUIWindow_CurrentMenu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
432 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
433 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
434 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
435
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
436 case UIMSG_ResetKeyMapping:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
437 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
438 v197 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
439 pKeyActionMap->SetDefaultMapping();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
440 for (uint i = 0; i < 28; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
441 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
442 if (pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
443 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
444 if (v197)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
445 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
446 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
447 v197 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
448 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
449 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
450 GUI_ReplaceHotkey(LOBYTE(pPrevVirtualCidesMapping[i]), pKeyActionMap->GetActionVKey((enum InputAction)i), 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
451 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
452 pPrevVirtualCidesMapping[i] = pKeyActionMap->GetActionVKey((enum InputAction)i);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
453 GameMenuUI_InvaligKeyBindingsFlags[i] = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
454 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
455 pAudioPlayer->PlaySound(SOUND_chimes, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
456 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
457 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
458
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
459 case UIMSG_SelectKeyPage1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
460 KeyboardPageNum = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
461 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
462 case UIMSG_SelectKeyPage2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
463 KeyboardPageNum = 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
464 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
465
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
466 case UIMSG_OpenVideoOptions:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
467 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
468 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
469
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
470 pGUIWindow_CurrentMenu->Release();
2546
4087cbc62706 GameMenu logic moved to GUIWindow_GameMenu
a.parshin
parents: 2544
diff changeset
471 pGUIWindow_CurrentMenu = new GUIWindow_GameVideoOptions();//GameMenuUI_OptionsVideo_Load();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
472 viewparams->field_48 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
473 current_screen_type = SCREEN_VIDEO_OPTIONS;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
474
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
475 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
476 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
477
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
478 case UIMSG_1A9:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
479 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
480 if (uMessageParam == 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
481 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
482 //--uGammaPos;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
483 if ((uGammaPos-- - 1) < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
484 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
485 uGammaPos = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
486 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
487 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
488 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
489 v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
490 //pEngine->pGammaController->Initialize(v19);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
491 new OnButtonClick2(21, 161, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
492 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
493 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
494 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
495 if (uMessageParam == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
496 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
497 ++uGammaPos;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
498 if ((signed int)uGammaPos <= 9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
499 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
500 v21 = (double)(signed int)uGammaPos * 0.1 + 0.6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
501 //pEngine->pGammaController->Initialize(v21);
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
502 new OnButtonClick2(213, 161, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
503 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
504 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
505 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
506 uGammaPos = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
507 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
508 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
509 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
510 uGammaPos = (pMouse->GetCursorPos(&a2)->x - 42) / 17;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
511 v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
512 //pEngine->pGammaController->Initialize(v22);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
513 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
514 pAudioPlayer->PlaySound(SOUND_ClickMovingSelector, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
515 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
516 case UIMSG_ToggleBloodsplats:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
517 pEngine->ToggleFlags2(0x20u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
518 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
519 case UIMSG_ToggleColoredLights:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
520 pRenderer->ToggleColoredLights();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
521 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
522 case UIMSG_ToggleTint:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
523 pRenderer->ToggleTint();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
524 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
525 case UIMSG_ChangeMusicVolume:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
526 extern bool use_music_folder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
527 if (uMessageParam == 4)//-
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
528 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
529 --uMusicVolimeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
530 if ((char)uMusicVolimeMultiplier < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
531 uMusicVolimeMultiplier = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
532 new OnButtonClick2(243, 216, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
533 if (uMusicVolimeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
534 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
535
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
536 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
537 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
538 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
539 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
540
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
541 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
542 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
543 if (uMessageParam == 5)//+
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
544 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
545 ++uMusicVolimeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
546 if ((char)uMusicVolimeMultiplier > 9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
547 uMusicVolimeMultiplier = 9;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
548 new OnButtonClick2(435, 216, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
549 if (uMusicVolimeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
550 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
551 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
552 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
553 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
554 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
555 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
556 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
557 uMusicVolimeMultiplier = (pMouse->GetCursorPos(&v202)->x - 263) / 17;//for mouse
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
558 if ((char)uMusicVolimeMultiplier > 9)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
559 uMusicVolimeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
560 if (uMusicVolimeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
561 pAudioPlayer->PlaySound(SOUND_hurp, -1, 0, -1, 0, 0, pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
562 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
563 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
564 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
565 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
566 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
567 case UIMSG_ChangeSoundVolume:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
568 if (uMessageParam == 4)//reduce sound level button left
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
569 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
570 --uSoundVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
571 if ((char)uSoundVolumeMultiplier < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
572 uSoundVolumeMultiplier = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
573 new OnButtonClick2(243, 162, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
574 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
575 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
576 int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
577 //v = v+1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
578 if (v)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
579 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
580 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
581 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
582 if (uMessageParam == 5)//Increase sound level button right
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
583 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
584 ++uSoundVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
585 if ((char)uSoundVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
586 uSoundVolumeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
587 //v168 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
588 v24 = 435;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
589 //v154 = (int)pBtn_SliderRight;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
590 new OnButtonClick2(v24, 162, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
591 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
592 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
593 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
594 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
595 uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
596 if ((char)uSoundVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
597 uSoundVolumeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
598 pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
599 pAudioPlayer->PlaySound(SOUND_church, -1, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
600 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
601 case UIMSG_ToggleFlipOnExit:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
602 bFlipOnExit = bFlipOnExit == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
603 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
604 case UIMSG_ToggleAlwaysRun:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
605 bAlwaysRun = bAlwaysRun == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
606 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
607 case UIMSG_ToggleWalkSound:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
608 bWalkSound = bWalkSound == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
609 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
610 case UIMSG_ToggleShowDamage:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
611 bShowDamage = bShowDamage == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
612 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
613 case UIMSG_ChangeVoiceVolume:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
614 if (uMessageParam == 4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
615 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
616 --uVoicesVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
617 if ((char)uVoicesVolumeMultiplier < 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
618 uVoicesVolumeMultiplier = 0;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
619 new OnButtonClick2(243, 270, 0, 0, (int)pBtn_SliderLeft, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
620 if (!uVoicesVolumeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
621 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
622 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
623 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
624 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
625 if (uMessageParam == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
626 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
627 ++uVoicesVolumeMultiplier;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
628 if ((char)uVoicesVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
629 uVoicesVolumeMultiplier = 9;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
630 new OnButtonClick2(435, 270, 0, 0, (int)pBtn_SliderRight, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
631 if (!uVoicesVolumeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
632 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
633 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
634 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
635 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
636 uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
637 if ((char)uVoicesVolumeMultiplier > 8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
638 uVoicesVolumeMultiplier = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
639 if (!uVoicesVolumeMultiplier)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
640 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
641 pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
642 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
643 case UIMSG_SetTurnSpeed:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
644 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
645 pParty->sRotationY = uMessageParam * pParty->sRotationY / uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
646 uTurnSpeed = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
647 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
648
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
649 case UIMSG_SetGraphicsMode:
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
650 //if ( !bUseLoResSprites )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
651 //{
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
652 // byte_6BE388_graphicsmode = uMessageParam;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
653 // MM7Initialization();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
654 // continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
655 //}
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
656 //if ( uMessageParam )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
657 //{
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
658 // if ( uMessageParam == 1 )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
659 // {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
660 // byte_6BE388_graphicsmode = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
661 // }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
662 // else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
663 // {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
664 // if ( uMessageParam != 2 )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
665 // continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
666 // byte_6BE388_graphicsmode = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
667 // }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
668 // MM7Initialization();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
669 // continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
670 //}
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
671 pModalWindow = new GUIWindow_Modal(pNPCTopics[453].pText, UIMSG_0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
672 __debugbreak(); // Nomad: graphicsmode as it was now removed
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
673 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
674
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
675 case UIMSG_GameMenu_ReturnToGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
676 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
677 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
678 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
679 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
680 stru_506E40.Release();
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
681 continue;*/
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
682 case UIMSG_OpenQuestBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
683 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
684 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
685 pGUIWindow_CurrentMenu->Release();
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
686 pGUIWindow_CurrentMenu = new GUIWindow_QuestBook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
687 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
688 case UIMSG_OpenAutonotes:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
689 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
690 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
691 pGUIWindow_CurrentMenu->Release();
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
692 pGUIWindow_CurrentMenu = new GUIWindow_AutonotesBook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
693 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
694 case UIMSG_OpenMapBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
695 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
696 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
697 pGUIWindow_CurrentMenu->Release();
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
698 pGUIWindow_CurrentMenu = new GUIWindow_MapBook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
699 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
700 case UIMSG_OpenCalendar:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
701 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
702 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
703 pGUIWindow_CurrentMenu->Release();
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
704 pGUIWindow_CurrentMenu = new GUIWindow_CalendarBook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
705 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
706 case UIMSG_OpenHistoryBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
707 DoThatMessageThing();
2542
a.parshin
parents: 2541
diff changeset
708 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
709 pGUIWindow_CurrentMenu->Release();
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
710 pGUIWindow_CurrentMenu = new GUIWindow_JournalBook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
711 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
712 case UIMSG_Escape:// нажатие Escape and return to game
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
713 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
714 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
715 switch (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
716 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
717 case SCREEN_E:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
718 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
719 case SCREEN_NPC_DIALOGUE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
720 case SCREEN_CHEST:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
721 case SCREEN_CHEST_INVENTORY:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
722 case SCREEN_CHANGE_LOCATION:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
723 case SCREEN_INPUT_BLV:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
724 case SCREEN_QUICK_REFERENCE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
725 if (dword_50CDC8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
726 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
727 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
728 uMessageParam = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
729 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
730 case SCREEN_HOUSE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
731 if (!dword_50CDC8)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
732 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
733 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
734 uMessageParam = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
735 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
736 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
737 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
738 }
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
739 if (pModalWindow)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
740 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
741 pModalWindow->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
742 pModalWindow = nullptr;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
743 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
744 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
745 pRenderer->ClearZBuffer(0, 479);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
746 viewparams->bRedrawGameUI = true;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
747 viewparams->field_48 = 1;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
748 if (current_screen_type == SCREEN_GAME)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
749 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
750 if (!pGUIWindow_CastTargetedSpell)//Draw Menu
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
751 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
752 dword_6BE138 = -1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
753 new OnButtonClick2(0x25Au, 0x1C2u, 0, 0, (int)pBtn_GameSettings, (char *)1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
754
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
755 DoThatMessageThing();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
756 GameMenu_Loop();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
757 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
758 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
759 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
760 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
761 pGUIWindow_CastTargetedSpell = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
762 pMouse->SetCursorBitmap("MICON1");
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
763 GameUI_Footer_TimeLeft = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
764 _50C9A0_IsEnchantingInProgress = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
765 back_to_game();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
766 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
767 continue;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
768 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
769 else if (current_screen_type == SCREEN_MENU)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
770 {/*
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
771 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
772 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
773 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
774 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
775 stru_506E40.Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
776 Game_OnEscape();*/
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
777 break;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
778 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
779 else if (current_screen_type == SCREEN_SAVEGAME || current_screen_type == SCREEN_LOADGAME)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
780 {/*
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
781 pIcons_LOD->RemoveTexturesPackFromTextureList();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
782 //crt_deconstruct_ptr_6A0118();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
783 stru_506E40.Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
784 Game_OnEscape();*/
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
785 break;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
786 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
787 else if (current_screen_type == SCREEN_OPTIONS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
788 {/*
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
789 options_menu_skin.Relaease();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
790 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
791 WriteWindowsRegistryInt("soundflag", (char)uSoundVolumeMultiplier);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
792 WriteWindowsRegistryInt("musicflag", (char)uMusicVolimeMultiplier);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
793 WriteWindowsRegistryInt("CharVoices", (char)uVoicesVolumeMultiplier);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
794 WriteWindowsRegistryInt("WalkSound", bWalkSound);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
795 WriteWindowsRegistryInt("ShowDamage", bShowDamage);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
796 //WriteWindowsRegistryInt("graphicsmode", (unsigned __int8)byte_6BE388_graphicsmode);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
797 WriteWindowsRegistryInt("valAlwaysRun", bAlwaysRun);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
798 WriteWindowsRegistryInt("FlipOnExit", bFlipOnExit);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
799 if (uTurnSpeed == 0)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
800 WriteWindowsRegistryInt("TurnDelta", 3);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
801 else if (uTurnSpeed == 64)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
802 WriteWindowsRegistryInt("TurnDelta", 2);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
803 else if (uTurnSpeed == 128)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
804 WriteWindowsRegistryInt("TurnDelta", 1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
805 stru_506E40.Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
806 Game_OnEscape();*/
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
807 break;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
808 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
809 else if (current_screen_type == SCREEN_VIDEO_OPTIONS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
810 {/*
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
811 //if ( pRenderer->pRenderD3D )
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
812 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
813 WriteWindowsRegistryInt("Colored Lights", pRenderer->bUseColoredLights);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
814 WriteWindowsRegistryInt("Tinting", pRenderer->bTinting);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
815 WriteWindowsRegistryInt("Bloodsplats", (LOBYTE(pEngine->uFlags2) >> 5) & 1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
816 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
817
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
818 stru_506E40.Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
819 Game_OnEscape();*/
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
820 break;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
821 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
822 else if (current_screen_type == SCREEN_KEYBOARD_OPTIONS)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
823 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
824 /*v197 = 1;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
825 pKeyBindingFlag = false;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
826 for (uint i = 0; i < 28; ++i)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
827 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
828 if (GameMenuUI_InvaligKeyBindingsFlags[i])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
829 pKeyBindingFlag = true;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
830 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
831 if (!pKeyBindingFlag)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
832 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
833 for (uint i = 0; i < 5; i++)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
834 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
835 if (uTextureID_Optkb[i])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
836 pIcons_LOD->pTextures[uTextureID_Optkb[i]].Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
837 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
838 memset(&uTextureID_Optkb, 0, 20);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
839 pIcons_LOD->SyncLoadedFilesCount();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
840 for (uint i = 0; i < 28; ++i)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
841 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
842 if (pKeyActionMap->GetActionVKey((enum InputAction)i) != pPrevVirtualCidesMapping[i])
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
843 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
844 if (v197)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
845 {
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
846 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 1);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
847 v197 = 0;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
848 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
849 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
850 GUI_ReplaceHotkey(pKeyActionMap->GetActionVKey((enum InputAction)i), LOBYTE(pPrevVirtualCidesMapping[i]), 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
851 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
852 if (i > 3 && i != 25 && i != 26)
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
853 pKeyToggleType = TOGGLE_OneTimePress;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
854 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
855 pKeyToggleType = TOGGLE_Continuously;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
856 pKeyActionMap->SetKeyMapping(i, pPrevVirtualCidesMapping[i], pKeyToggleType);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
857 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
858 pKeyActionMap->StoreMappings();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
859 stru_506E40.Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
860 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
861 else
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
862 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
863
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
864 Game_OnEscape();*/
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
865 break;
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
866 }
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
867 else
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
868 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
869 if (current_screen_type > SCREEN_67)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
870 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
871 if (current_screen_type == SCREEN_QUICK_REFERENCE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
872 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
873 pIcons_LOD->RemoveTexturesPackFromTextureList();
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
874 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
875 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
876 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
877 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
878 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
879 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
880 if (current_screen_type < SCREEN_64)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
881 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
882 switch (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
883 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
884 case SCREEN_CASTING:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
885 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
886 if (some_active_character)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
887 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
888 uActiveCharacter = some_active_character;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
889 uActiveCharacter = pParty->GetNextActiveCharacter();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
890 some_active_character = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
891 if (pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
892 pTurnEngine->ApplyPlayerAction();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
893 _50C9D0_AfterEnchClickEventId = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
894 _50C9D4_AfterEnchClickEventSecondParam = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
895 _50C9D8_AfterEnchClickEventTimeout = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
896 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
897 if (ptr_50C9A4_ItemToEnchant && ptr_50C9A4_ItemToEnchant->uItemID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
898 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
899 LOBYTE(ptr_50C9A4_ItemToEnchant->uAttributes) &= 0xFu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
900 _50C9A8_item_enchantment_timer = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
901 ptr_50C9A4_ItemToEnchant = nullptr;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
902 }
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
903 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
904 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
905 case SCREEN_BOOKS:
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
906 pBooksButtonOverlay->Release();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
907 //crt_deconstruct_ptr_6A0118();
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
908 pBooksButtonOverlay = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
909 pEventTimer->Resume();
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
910 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
911 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
912 case SCREEN_CHEST_INVENTORY:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
913 current_screen_type = SCREEN_CHEST;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
914 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
915 case SCREEN_CHEST:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
916 pWindow2 = pChestWindow;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
917 pWindow2->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
918 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
919 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
920 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
921 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
922 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
923 case SCREEN_19:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
924 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
925 pWindow2 = ptr_507BC8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
926 pWindow2->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
927 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
928 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
929 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
930 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
931 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
932 case SCREEN_REST://close rest screen
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
933 if (_506F14_resting_stage)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
934 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
935 Rest(_506F18_num_minutes_to_sleep);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
936 pParty->pPlayers[3].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
937 pParty->pPlayers[2].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
938 pParty->pPlayers[1].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
939 pParty->pPlayers[0].SetAsleep(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
940 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
941 pTexture_RestUI_CurrentSkyFrame->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
942 pTexture_RestUI_CurrentHourglassFrame->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
943 pTexture_RestUI_CurrentHourglassFrame = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
944 pTexture_RestUI_CurrentSkyFrame = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
945 pIcons_LOD->SyncLoadedFilesCount();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
946 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
947 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
948 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
949 pOutdoor->UpdateSunlightVectors();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
950 pOutdoor->UpdateFog();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
951 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
952 _506F18_num_minutes_to_sleep = 0;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
953 _506F14_resting_stage = 0;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
954 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
955 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
956 case SCREEN_E:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
957 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
958 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
959 current_screen_type = SCREEN_HOUSE;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
960 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
961 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
962 case SCREEN_HOUSE:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
963 if (uDialogueType)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
964 uDialogueType = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
965 if (uGameState == GAME_STATE_CHANGE_LOCATION)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
966 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
967 while (HouseDialogPressCloseBtn())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
968 ;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
969 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
970 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
971 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
972 if (HouseDialogPressCloseBtn())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
973 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
974 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
975 GetHouseGoodbyeSpeech();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
976 pAudioPlayer->PlaySound(SOUND_WoodDoorClosing, 814, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
977 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
978 pGUIWindow_CurrentMenu = window_SpeakInHouse;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
979 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
980 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
981 case SCREEN_INPUT_BLV://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
982 if (uCurrentHouse_Animation == 153)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
983 PlayHouseSound(0x99u, HouseSound_Greeting_2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
984 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
985 if (npcIdToDismissAfterDialogue)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
986 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
987 pParty->hirelingScrollPosition = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
988 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
989 pParty->CountHirelings();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
990 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
991 npcIdToDismissAfterDialogue = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
992 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
993 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
994 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
995 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
996 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
997 case SCREEN_NPC_DIALOGUE://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
998 if (npcIdToDismissAfterDialogue)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
999 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1000 pParty->hirelingScrollPosition = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1001 LOBYTE(pNPCStats->pNewNPCData[npcIdToDismissAfterDialogue].uFlags) &= 0x7Fu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1002 pParty->CountHirelings();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1003 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1004 npcIdToDismissAfterDialogue = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1005 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1006 //goto LABEL_317;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1007 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1008 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1009 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1010 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1011 case SCREEN_BRANCHLESS_NPC_DIALOG://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1012 memset(GameUI_Footer_TimedString.data(), 0, 0xC8u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1013 sub_4452BB();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1014 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1015 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1016 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1017 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1018 case SCREEN_CHANGE_LOCATION://click escape
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1019 if (pParty->vPosition.x < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1020 pParty->vPosition.x = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1021 if (pParty->vPosition.x > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1022 pParty->vPosition.x = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1023 if (pParty->vPosition.y < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1024 pParty->vPosition.y = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1025 if (pParty->vPosition.y > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1026 pParty->vPosition.y = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1027 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1028 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1029 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1030 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1031 case SCREEN_VIDEO:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1032 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1033 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1034 case SCREEN_CHARACTERS:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1035 CharacterUI_ReleaseButtons();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1036 ReleaseAwardsScrollBar();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1037 pIcons_LOD->RemoveTexturesPackFromTextureList();
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1038 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1039 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1040 default:
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1041 __debugbreak(); // which GAME_MENU is this?
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1042 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1043 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1044 }
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1045 __debugbreak(); // which GAME_MENU is this?
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1046 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1047 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1048 }
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1049 __debugbreak(); // which GAME_MENU is this?
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1050 CharacterUI_ReleaseButtons();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1051 ReleaseAwardsScrollBar();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1052 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1053 }
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1054 __debugbreak(); // which GAME_MENU is this?
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1055 Game_OnEscape();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1056 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1057 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1058 continue;
2542
a.parshin
parents: 2541
diff changeset
1059
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1060 case UIMSG_ScrollNPCPanel://Right and Left button for NPCPanel
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1061 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1062 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1063 new OnButtonClick2(626, 179, 0, 0, (int)pBtn_NPCRight, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1064 v37 = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + (unsigned __int8)pParty->field_70A - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1065 if (pParty->hirelingScrollPosition < v37)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1066 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1067 ++pParty->hirelingScrollPosition;//??? maybe number of the first cell???
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1068 if (pParty->hirelingScrollPosition >= v37)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1069 pParty->hirelingScrollPosition = (pParty->pHirelings[0].pName != 0) + (pParty->pHirelings[1].pName != 0) + pParty->field_70A - 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1070 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1071 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1072 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1073 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1074 new OnButtonClick2(469, 179, 0, 0, (int)pBtn_NPCLeft, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1075 /*if ( pParty->field_709 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1076 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1077 --pParty->field_709;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1078 if ( pParty->field_709 < 1 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1079 pParty->field_709 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1080 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1081 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1082 GameUI_DrawHiredNPCs();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1083 continue;
2542
a.parshin
parents: 2541
diff changeset
1084
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1085 case UIMSG_TransitionUI_Confirm:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1086 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1087 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1088 sub_42FBDD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1089 PlayHouseSound(uCurrentHouse_Animation, HouseSound_NotEnoughMoney_TrainingSuccessful);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1090
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1091 if (pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1092 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1093 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1094 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1095 if (dword_59117C_teleportx | dword_591178_teleporty | dword_591174_teleportz | dword_591170_teleport_directiony | dword_59116C_teleport_directionx | dword_591168_teleport_speedz)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1096 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1097 if (dword_59117C_teleportx)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1098 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1099 pParty->vPosition.x = dword_59117C_teleportx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1100 _5B65A8_npcdata_uflags_or_other = dword_59117C_teleportx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1101 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1102 if (dword_591178_teleporty)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1103 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1104 pParty->vPosition.y = dword_591178_teleporty;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1105 _5B65AC_npcdata_fame_or_other = dword_591178_teleporty;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1106 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1107 if (dword_591174_teleportz)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1108 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1109 pParty->vPosition.z = dword_591174_teleportz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1110 _5B65B0_npcdata_rep_or_other = dword_591174_teleportz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1111 pParty->uFallStartY = dword_591174_teleportz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1112 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1113 if (dword_591170_teleport_directiony)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1114 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1115 pParty->sRotationY = dword_591170_teleport_directiony;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1116 _5B65B4_npcdata_loword_house_or_other = dword_591170_teleport_directiony;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1117 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1118 if (dword_59116C_teleport_directionx)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1119 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1120 pParty->sRotationX = dword_59116C_teleport_directionx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1121 _5B65B8_npcdata_hiword_house_or_other = dword_59116C_teleport_directionx;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1122 v38 = dword_591168_teleport_speedz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1123 pParty->uFallSpeed = dword_591168_teleport_speedz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1124 dword_5B65BC = dword_591168_teleport_speedz;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1125 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1126 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1127 v38 = dword_5B65BC;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1128 if (*dword_591164_teleport_map_name != 48)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1129 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1130 pGameLoadingUI_ProgressBar->uType = (GUIProgressBar::Type)2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1131 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;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1132 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1133 Transition_StopSound_Autosave(dword_591164_teleport_map_name, MapStartPoint_Party);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1134 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1135 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1136 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1137 EventProcessor(dword_5C3418, 0, 1, dword_5C341C);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1138 if (!_stricmp(byte_6BE3B0.data(), "d05.blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1139 pParty->uTimePlayed += 1474560i64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1140 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1141 case UIMSG_TransitionWindowCloseBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1142 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1143 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1144 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1145 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1146 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1147 case UIMSG_CycleCharacters:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1148 v39 = GetAsyncKeyState(VK_SHIFT);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1149 uActiveCharacter = CycleCharacter(v39);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1150 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1151 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1152 case UIMSG_OnTravelByFoot:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1153 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1154 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1155 sub_42FBDD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1156 //pNPCData4 = (NPCData *)GetTravelTime();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1157 strcpy(pOutdoor->pLevelFilename, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1158 if (bUnderwater != 1 && pParty->bFlying
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1159 || pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pOut, 20) != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1160 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1161 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1162 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1163 if (pParty->vPosition.x < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1164 pParty->vPosition.x = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1165 if (pParty->vPosition.x > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1166 pParty->vPosition.x = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1167 if (pParty->vPosition.y < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1168 pParty->vPosition.y = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1169 if (pParty->vPosition.y > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1170 pParty->vPosition.y = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1171 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1172 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1173 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1174 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1175 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1176 pParty->field_6E4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1177 pParty->field_6E0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1178 CastSpellInfoHelpers::_427D48();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1179 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1180 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1181 pGameLoadingUI_ProgressBar->Initialize(GUIProgressBar::TYPE_Box);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1182 ++pGameLoadingUI_ProgressBar->uProgressMax;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1183 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1184 pGameLoadingUI_ProgressBar->Progress();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1185 RestAndHeal(1440 * (signed int)GetTravelTime());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1186 if (pParty->uNumFoodRations)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1187 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1188 pParty->RestAndHeal();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1189 if (((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1190 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1191 pPlayer7 = pParty->pPlayers.data();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1192 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1193 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1194 pPlayer7->SetCondition(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1195 ++pPlayer7;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1196 } while ((signed int)pPlayer7 < (signed int)pParty->pHirelings.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1197 ++pParty->days_played_without_rest;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1198 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1199 Party::TakeFood((unsigned int)GetTravelTime());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1200 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1201 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1202 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1203 pPlayer8 = pParty->pPlayers.data();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1204 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1205 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1206 pPlayer8->SetCondition(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1207 ++pPlayer8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1208 } while ((signed int)pPlayer8 < (signed int)pParty->pHirelings.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1209 ++pParty->days_played_without_rest;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1210 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1211 pPaletteManager->ResetNonLocked();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1212 pSpriteFrameTable->ResetSomeSpriteFlags();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1213 strcpy(pCurrentMapName, pOut);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1214 strcpy(pLevelName, pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1215 v41 = strtok(pLevelName, ".");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1216 strcpy(pLevelName, v41);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1217 Level_LoadEvtAndStr(pLevelName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1218 pDecalBuilder->Reset(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1219 LoadLevel_InitializeLevelEvt();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1220 uLevelMapStatsID = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1221 bUnderwater = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1222 bNoNPCHiring = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1223 pEngine->uFlags2 &= 0xFFFFFFF7u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1224 if (Is_out15odm_underwater())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1225 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1226 bUnderwater = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1227 pEngine->uFlags2 |= 8u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1228 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1229 if (!_stricmp(pCurrentMapName, "out15.odm") || !_stricmp(pCurrentMapName, "d47.blv"))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1230 bNoNPCHiring = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1231 PrepareToLoadODM(1u, (ODMRenderParams *)1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1232 pAudioPlayer->SetMapEAX();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1233 bDialogueUI_InitializeActor_NPC_ID = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1234 OnMapLoad();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1235 pOutdoor->SetFog();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1236 TeleportToStartingPoint(uLevel_StartingPointType);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1237 pParty->vPosition.z = GetTerrainHeightsAroundParty2(pParty->vPosition.x, pParty->vPosition.y, &v213, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1238 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1239 _461103_load_level_sub();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1240 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1241 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1242 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1243 pGameLoadingUI_ProgressBar->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1244 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1245 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1246 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1247 case UIMSG_CHANGE_LOCATION_ClickCencelBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1248 CloseWindowBackground();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1249 if (pParty->vPosition.x < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1250 pParty->vPosition.x = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1251 if (pParty->vPosition.x > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1252 pParty->vPosition.x = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1253 if (pParty->vPosition.y < -22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1254 pParty->vPosition.y = -22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1255 if (pParty->vPosition.y > 22528)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1256 pParty->vPosition.y = 22528;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1257 DialogueEnding();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1258 current_screen_type = SCREEN_GAME;
2542
a.parshin
parents: 2541
diff changeset
1259 viewparams->bRedrawGameUI = true;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1260 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1261 case UIMSG_CastSpell_Telekinesis:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1262 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1263 LOWORD(v42) = pEngine->pVisInstance->get_picked_object_zbuf_val();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1264 /*else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1265 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1266 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v210);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1267 pPoint = pMouse->GetCursorPos(&v208);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1268 v42 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint->y]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1269 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1270 v44 = (unsigned __int16)v42;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1271 v45 = PID_TYPE(v44);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1272 uNumSeconds = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1273 v46 = PID_ID(v44);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1274 if (v45 == 3)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1275 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1276 v47 = pActors[v46].uAIState == Dead;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1277 if (!v47)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1278 continue;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1279 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1280 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1281 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1282 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1283 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1284 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1285 pGUIWindow_CastTargetedSpell = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1286 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1287 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1288 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1289 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1290 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1291 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1292 if (v45 == 2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1293 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1294 v47 = (pObjectList->pObjects[pSpriteObjects[v46].uObjectDescID].uFlags & 0x10) == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1295 if (!v47)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1296 continue;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1297 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1298 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1299 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1300 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1301 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1302 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1303 pGUIWindow_CastTargetedSpell = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1304 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1305 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1306 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1307 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1308 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1309 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1310 if (v45 == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1311 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1312 v48 = pLevelDecorations[v46].uEventID == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1313 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1314 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1315 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1316 if (v45 != 6)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1317 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1318 if (uCurrentlyLoadedLevelType != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1319 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1320 pODMFace = &pOutdoor->pBModels[v44 >> 9].pFaces[v46 & 0x3F];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1321 if (!pODMFace->Clickable() || !pODMFace->sCogTriggeredID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1322 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1323 v44 = uNumSeconds;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1324 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1325 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1326 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1327 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1328 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1329 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1330 pGUIWindow_CastTargetedSpell = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1331 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1332 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1333 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1334 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1335 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1336 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1337 pBLVFace = &pIndoor->pFaces[v46];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1338 if (!pBLVFace->Clickable())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1339 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1340 v48 = pIndoor->pFaceExtras[pBLVFace->uFaceExtraID].uEventID == 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1341 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1342 if (v48)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1343 continue;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1344 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1345 pSpellInfo->uFlags &= ~0x40u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1346 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1347 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1348 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1349 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1350 pGUIWindow_CastTargetedSpell = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1351 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1352 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1353 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1354 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1355 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1356 case UIMSG_CastSpell_Character_Big_Improvement://Preservation and blessing, treatment paralysis, hand hammers(individual upgrade)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1357 case UIMSG_CastSpell_Character_Small_Improvement://Fate, cure
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1358 case UIMSG_HiredNPC_CastSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1359 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1360 if (_50C9A0_IsEnchantingInProgress)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1361 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1362 uActiveCharacter = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1363 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1364 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1365 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1366 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1367 if (pGUIWindow_CastTargetedSpell)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1368 {
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1369 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1370 switch (uMessage)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1371 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1372 case UIMSG_CastSpell_Character_Big_Improvement:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1373 pSpellInfo->uFlags &= ~0x02u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1374 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1375 case UIMSG_CastSpell_Character_Small_Improvement:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1376 pSpellInfo->uFlags &= ~0x0100u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1377 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1378 case UIMSG_HiredNPC_CastSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1379 pSpellInfo->uFlags &= ~0x0200u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1380 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1381 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1382 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1383 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1384 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1385 pGUIWindow_CastTargetedSpell = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1386 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1387 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1388 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1389 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1390 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1391 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1392 continue;
2542
a.parshin
parents: 2541
diff changeset
1393
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1394 case UIMSG_BF:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1395 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1396 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1397 sub_42FBDD();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1398 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1399 strcpy(pCurrentMapName, pMapStats->pInfos[uHouse_ExitPic].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1400 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1401 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1402 //v53 = p2DEvents_minus1_::30[26 * (unsigned int)ptr_507BC0->ptr_1C];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1403 v53 = p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]._quest_related;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1404 if (v53 < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1405 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1406 v54 = abs(v53) - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1407 _5B65B8_npcdata_hiword_house_or_other = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1408 dword_5B65BC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1409 v55 = dword_4E4560[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1410 _5B65AC_npcdata_fame_or_other = dword_4E4578[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1411 v56 = dword_4E4590[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1412 v57 = dword_4E45A8[v54];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1413 _5B65A8_npcdata_uflags_or_other = v55;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1414 _5B65B4_npcdata_loword_house_or_other = v57;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1415 _5B65B0_npcdata_rep_or_other = v56;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1416 dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1417 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1418 HouseDialogPressCloseBtn();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1419 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1420 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1421
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1422 case UIMSG_OnCastTownPortal:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1423 pAudioPlayer->StopChannels(-1, -1);
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
1424 pGUIWindow_CurrentMenu = new GUIWindow_TownPortalBook((char *)uMessageParam);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1425 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1426
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1427 case UIMSG_OnCastLloydsBeacon:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1428 pAudioPlayer->StopChannels(-1, -1);
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
1429 pGUIWindow_CurrentMenu = new GUIWindow_LloydsBook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1430 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1431
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1432 case UIMSG_LloydsBeacon_FlippingBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1433 bRecallingBeacon = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1434 v127 = uMessageParam + 204;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1435 pAudioPlayer->PlaySound((SoundID)v127, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1436 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1437 case UIMSG_HintBeaconSlot:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1438 if (!pGUIWindow_CurrentMenu)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1439 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1440 pPlayer = pPlayers[_506348_current_lloyd_playerid + 1];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1441 uNumSeconds = (unsigned int)&pPlayer->pInstalledBeacons[uMessageParam];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1442 if (bRecallingBeacon)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1443 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1444 if (!*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1445 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1446 v173 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(pPlayer->pInstalledBeacons[uMessageParam].SaveFileID)].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1447 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[474], v173);// "Recall to %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1448 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1449 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1450 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1451 pMapNum = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1452 pMapName = "Not in Map Stats";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1453 if (pMapNum)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1454 pMapName = pMapStats->pInfos[pMapNum].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1455 if (!*((int *)&pSavegameThumbnails[10 * uMessageParam].pPixels) || !pMapNum)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1456 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1457 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[476], pMapName);// "Set to %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1458 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1459 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1460 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1461 v174 = pMapStats->pInfos[pMapStats->sub_410D99_get_map_index(*(short *)(uNumSeconds + 26))].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1462 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[475], (unsigned int)pMapName, v174);// "Set %s over %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1463 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1464 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1465 case UIMSG_CloseAfterInstallBeacon:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1466 dword_50CDC8 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1467 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1468 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1469 case UIMSG_InstallBeacon:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1470 pPlayer9 = pPlayers[_506348_current_lloyd_playerid + 1];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1471 if (!pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime && bRecallingBeacon)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1472 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1473 byte_506360 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1474 pPlayer9->CanCastSpell(uRequiredMana);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1475 if (pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1476 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1477 v60 = sRecoveryTime;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1478 pParty->pTurnBasedPlayerRecoveryTimes[_506348_current_lloyd_playerid] = sRecoveryTime;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1479 pPlayer9->SetRecoveryTime(v60);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1480 pTurnEngine->ApplyPlayerAction();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1481 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1482 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1483 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1484 pPlayer9->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * (double)sRecoveryTime * 2.133333333333333));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1485 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1486 pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[lloyds_beacon_spell_id], 0, 0, -1, 0, lloyds_beacon_sound_id, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1487 if (bRecallingBeacon)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1488 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1489 if (_stricmp(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1490 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1491 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1492 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1493 strcpy(pCurrentMapName, (const char *)&pGames_LOD->pSubIndices[pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1494 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1495 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1496 _5B65A8_npcdata_uflags_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1497 _5B65AC_npcdata_fame_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1498 _5B65B0_npcdata_rep_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1499 _5B65B4_npcdata_loword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1500 _5B65B8_npcdata_hiword_house_or_other = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1501 dword_5B65C0 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1502 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1503 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1504 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1505 pParty->vPosition.x = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1506 pParty->vPosition.y = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1507 pParty->vPosition.z = pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1508 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1509 pParty->sRotationY = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1510 pParty->sRotationX = pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1511 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1512 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
1513 pBooksButtonOverlay->Release();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1514 pGUIWindow_CurrentMenu->Release();
2548
87e5590d034b All Books windows are refactored into respective classes
a.parshin
parents: 2547
diff changeset
1515 pBooksButtonOverlay = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1516 pGUIWindow_CurrentMenu = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1517 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1518 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1519 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1520 sprintf(a1, "data\\lloyd%d%d.pcx", _506348_current_lloyd_playerid + 1, uMessageParam + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1521 pRenderer->SaveScreenshot(a1, 92, 68);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1522 LoadThumbnailLloydTexture(uMessageParam, _506348_current_lloyd_playerid + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1523 pPlayer9->pInstalledBeacons[uMessageParam].uBeaconTime = pParty->uTimePlayed + (signed __int64)((double)(lloyds_beacon_spell_level << 7) * 0.033333335);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1524 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_X = pParty->vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1525 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Y = pParty->vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1526 pPlayer9->pInstalledBeacons[uMessageParam].PartyPos_Z = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1527 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_X = LOWORD(pParty->sRotationY);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1528 pPlayer9->pInstalledBeacons[uMessageParam].PartyRot_Y = LOWORD(pParty->sRotationX);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1529 if ((signed int)pGames_LOD->uNumSubDirs / 2 <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1530 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1531 for (thisg = 0; thisg < (signed int)pGames_LOD->uNumSubDirs / 2; ++thisg)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1532 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1533 if (!_stricmp(pGames_LOD->pSubIndices[thisg].pFilename, pCurrentMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1534 pPlayer9->pInstalledBeacons[uMessageParam].SaveFileID = thisg;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1535 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1536 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1537 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1538 case UIMSG_ClickTownInTP:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1539 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1540 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1541 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1542 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1543 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1544 v63 = 208;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1545 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1546 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1547 v63 = 207;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1548 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1549 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1550 v63 = 211;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1551 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1552 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1553 v63 = 209;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1554 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1555 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1556 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1557 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1558 LABEL_486:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1559 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1560 v64 = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1561 v65 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1562 if (v64 == TownPortalList[uMessageParam].uMapInfoID)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1563 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1564 pParty->vPosition.x = TownPortalList[v65].pos.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1565 pParty->vPosition.y = TownPortalList[v65].pos.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1566 pParty->vPosition.z = TownPortalList[v65].pos.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1567 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1568 pParty->sRotationY = TownPortalList[v65].rot_y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1569 pParty->sRotationX = TownPortalList[v65].rot_x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1570 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1571 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1572 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1573 SaveGame(1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1574 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1575 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1576 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1577 strcpy(pCurrentMapName, pMapStats->pInfos[TownPortalList[uMessageParam].uMapInfoID].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1578 dword_5B65C0 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1579 _5B65A8_npcdata_uflags_or_other = TownPortalList[uMessageParam].pos.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1580 _5B65AC_npcdata_fame_or_other = TownPortalList[uMessageParam].pos.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1581 _5B65B0_npcdata_rep_or_other = TownPortalList[uMessageParam].pos.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1582 v66 = TownPortalList[uMessageParam].rot_x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1583 _5B65B4_npcdata_loword_house_or_other = TownPortalList[uMessageParam].rot_y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1584 _5B65B8_npcdata_hiword_house_or_other = v66;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1585 Actor::InitializeActors();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1586 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1587 v67 = (char*)pGUIWindow_CurrentMenu->Hint;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1588 if (v67)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1589 *((int *)v67 + 17) = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1590 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1591 pParty->pPlayers[(unsigned __int8)town_portal_caster_id].CanCastSpell(0x14u);
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1592
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1593 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1594 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1595 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1596 v63 = 210;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1597 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1598 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1599 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1600 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1601 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1602 v63 = 206;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1603 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1604 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v63))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1605 return;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1606 goto LABEL_486;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1607 case UIMSG_HintTownPortal:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1608 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1609 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1610 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1611 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1612 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1613 v68 = 208;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1614 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1615 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1616 v68 = 207;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1617 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1618 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1619 v68 = 211;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1620 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1621 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1622 v68 = 209;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1623 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1624 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1625 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1626 //goto LABEL_506;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1627 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1628 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1629 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1630 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1631 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1632 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1633 v69 = pMapStats->pInfos[4].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1634 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1635 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1636 v69 = pMapStats->pInfos[3].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1637 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1638 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1639 v69 = pMapStats->pInfos[10].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1640 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1641 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1642 v69 = pMapStats->pInfos[7].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1643 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1644 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1645 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1646 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1647 __debugbreak(); // warning C4700: uninitialized local variable 'v200' used
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1648 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1649 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1650 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1651 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1652 v69 = pMapStats->pInfos[8].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1653 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1654 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1655 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1656 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1657 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1658 v69 = pMapStats->pInfos[21].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1659 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1660 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1661 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1662 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1663 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1664 v68 = 210;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1665 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1666 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1667 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1668 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1669 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1670 v68 = 206;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1671 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1672 if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, v68))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1673 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1674 pRenderer->DrawTextureRGB(0, 0x160u, pTexture_StatusBar);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1675 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1676 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1677 //LABEL_506:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1678 if (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1679 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1680 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1681 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1682 case 1:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1683 v69 = pMapStats->pInfos[4].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1684 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1685 case 2:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1686 v69 = pMapStats->pInfos[3].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1687 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1688 case 3:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1689 v69 = pMapStats->pInfos[10].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1690 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1691 case 4:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1692 v69 = pMapStats->pInfos[7].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1693 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1694 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1695 if (uMessageParam != 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1696 //goto LABEL_519;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1697 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1698 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v200);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1699 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1700 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1701 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1702 v69 = pMapStats->pInfos[8].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1703 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1704 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1705 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1706 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1707 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1708 v69 = pMapStats->pInfos[21].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1709 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1710 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[35], v69);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1711 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1712 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1713 case UIMSG_ShowFinalWindow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1714 sprintfex(pFinalMessage.data(), "%s\n \n%s\n \n%s", pGlobalTXT_LocalizationStrings[151],// "Congratulations Adventurer."
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1715 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."
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1716 pGlobalTXT_LocalizationStrings[167]);// "- The Might and Magic VII Development Team."
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
1717 pModalWindow = new GUIWindow_Modal(pFinalMessage.data(), UIMSG_OnFinalWindowClose);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1718 uGameState = GAME_STATE_FINAL_WINDOW;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1719 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1720 case UIMSG_OnFinalWindowClose:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1721 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1722 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1723 strcpy((char *)pKeyActionMap->pPressedKeysBuffer, "2");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1724 __debugbreak(); // missed break/continue?
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1725 case UIMSG_DD:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1726 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1727 sprintf(pTmpBuf.data(), "%s", pKeyActionMap->pPressedKeysBuffer);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1728 memcpy(&v216, txt_file_frametable_parser(pKeyActionMap->pPressedKeysBuffer, &v218), sizeof(v216));
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1729 if (v216.uPropCount == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1730 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1731 pNPCData4 = (NPCData *)((signed int)pGames_LOD->uNumSubDirs / 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1732 v70 = atoi(v216.pProperties[0]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1733 if (v70 <= 0 || v70 >= 77)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1734 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1735 v71 = v70;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1736 strcpy(Str2, pMapStats->pInfos[v70].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1737 pNPCData3 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1738 if ((signed int)pNPCData4 > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1739 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1740 thish = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1741 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1742 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1743 if (!_stricmp(pGames_LOD->pSubIndices[thish].pFilename, Str2))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1744 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1745 ++thish;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1746 pNPCData3 = (NPCData *)((char *)pNPCData3 + 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1747 } while ((signed int)pNPCData3 < (signed int)pNPCData4);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1748 if ((signed int)pNPCData3 < (signed int)pNPCData4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1749 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1750 strcpy(pCurrentMapName, pGames_LOD->pSubIndices[(int)pNPCData3].pFilename);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1751 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1752 uGameState = GAME_STATE_CHANGE_LOCATION;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1753 OnMapLeave();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1754 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1755 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1756 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1757 sprintf(Str2, "No map found for %s", pMapStats->pInfos[v71].pName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1758 v73 = Str2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1759 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1760 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1761 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1762 if (v216.uPropCount != 3)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1763 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1764 v74 = atoi(v216.pProperties[0]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1765 thisi = atoi(v216.pProperties[1]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1766 v75 = atoi(v216.pProperties[2]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1767 v76 = v75;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1768 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1769 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1770 if (pIndoor->GetSector(v74, thisi, v75))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1771 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1772 v77 = thisi;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1773 pParty->vPosition.x = v74;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1774 pParty->vPosition.y = v77;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1775 pParty->vPosition.z = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1776 pParty->uFallStartY = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1777 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1778 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1779 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1780 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1781 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1782 if (v74 > -32768)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1783 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1784 if (v74 < 32768)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1785 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1786 v77 = thisi;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1787 if (thisi > -32768)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1788 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1789 if (thisi < 32768 && v76 >= 0 && v76 < 10000)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1790 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1791 pParty->vPosition.x = v74;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1792 pParty->vPosition.y = v77;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1793 pParty->vPosition.z = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1794 pParty->uFallStartY = v76;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1795 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1796 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1797 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1798 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1799 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1800 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1801 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1802 v73 = "Can't jump to that location!";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1803 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1804 ShowStatusBarString(v73, 6);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1805 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1806 case UIMSG_CastQuickSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1807 if (bUnderwater == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1808 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1809 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1810 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1811 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1812 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1813 if (!uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1814 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1815 _42777D_CastSpell_UseWand_ShootArrow(pPlayer2->uQuickSpell, uActiveCharacter - 1, 0, 0, uActiveCharacter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1816 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1817 case UIMSG_CastSpell_Monster_Improvement:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1818 case UIMSG_CastSpell_Shoot_Monster://FireBlow, Lightning, Ice Lightning, Swarm,
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1819 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1820 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1821 v81 = pEngine->pVisInstance->get_picked_object_zbuf_val();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1822 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1823 /*else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1824 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1825 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v206);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1826 pPoint2 = pMouse->GetCursorPos(&v201);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1827 v81 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint2->y]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1828 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1829 v83 = v81;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1830 v44 = (unsigned __int16)v81;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1831 v84 = v83 >> 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1832 if (PID_TYPE(v44) != 3 || v84 >= 5120)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1833 continue;
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1834 pSpellInfo = (CastSpellInfo *)pGUIWindow_CastTargetedSpell->ptr_1C;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1835 if (uMessage == UIMSG_CastSpell_Shoot_Monster)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1836 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1837 pSpellInfo->uFlags &= ~0x08;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1838 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1839 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1840 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1841 if (uMessage == UIMSG_CastSpell_Monster_Improvement)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1842 pSpellInfo->uFlags &= ~0x0100u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1843 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1844 pSpellInfo->uFlags &= ~0x0200u;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1845 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1846 pSpellInfo->uPlayerID_2 = uMessageParam;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1847 pSpellInfo->spell_target_pid = v44;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1848 pParty->pPlayers[pSpellInfo->uPlayerID].SetRecoveryTime(300);
2554
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1849 pGUIWindow_CastTargetedSpell->Release();
f2a8ed07e921 Game Main Menu separated from Game logic
a.parshin
parents: 2549
diff changeset
1850 pGUIWindow_CastTargetedSpell = 0;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1851 pMouse->SetCursorBitmap("MICON1");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1852 GameUI_Footer_TimeLeft = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1853 _50C9A0_IsEnchantingInProgress = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1854 back_to_game();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1855 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1856 case UIMSG_1C:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1857 __debugbreak();
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1858 if (!uActiveCharacter || current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1859 continue;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1860 __debugbreak();//ptr_507BC8 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_68, uMessageParam, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1861 current_screen_type = SCREEN_19;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1862 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1863 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1864 case UIMSG_STEALFROMACTOR:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1865 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1866 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1867 if (pParty->bTurnBasedModeOn != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1868 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1869 if (pActors[uMessageParam].uAIState == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1870 pActors[uMessageParam].LootActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1871 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1872 Actor::StealFrom(uMessageParam);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1873 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1874 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1875 if (pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1876 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1877 if (!(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1878 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1879 if (pActors[uMessageParam].uAIState == 5)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1880 pActors[uMessageParam].LootActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1881 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1882 Actor::StealFrom(uMessageParam);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1883 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1884 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1885
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1886 case UIMSG_Attack:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1887 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1888 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1889 if (pParty->bTurnBasedModeOn != 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1890 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1891 Player::_42ECB5_PlayerAttacksActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1892 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1893 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1894 if (pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1895 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1896 if (!(pTurnEngine->field_18 & TE_HAVE_PENDING_ACTIONS))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1897 Player::_42ECB5_PlayerAttacksActor();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1898 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1899 case UIMSG_ExitRest:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1900 new OnCancel(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1901 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1902 case UIMSG_Wait5Minutes:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1903 if (_506F14_resting_stage == 2)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1904 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1905 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1906 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1907 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1908 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1909 new OnButtonClick2(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0,
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1910 (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes"
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1911 _506F14_resting_stage = 1;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1912 _506F18_num_minutes_to_sleep = 5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1913 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1914 case UIMSG_Wait1Hour:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1915 if (_506F14_resting_stage == 2)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1916 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1917 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1918 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1919 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1920 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
1921 new OnButtonClick2(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0,
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1922 (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour"
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1923 _506F14_resting_stage = 1;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1924 _506F18_num_minutes_to_sleep = 60;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1925 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1926 case UIMSG_RentRoom:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1927 _506F14_resting_stage = 2;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1928
2549
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
1929 pGUIWindow_CurrentMenu = new GUIWindow_Rest();
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1930
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1931 v86 = 60 * (_494820_training_time(pParty->uCurrentHour) + 1) - pParty->uCurrentMinute;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1932 _506F18_num_minutes_to_sleep = v86;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1933 if (uMessageParam == 111 || uMessageParam == 114 || uMessageParam == 116) // 107 = Emerald Isle tavern
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1934 _506F18_num_minutes_to_sleep = v86 + 12 * 60;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1935 _506F14_resting_stage = 2;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1936 pParty->RestAndHeal();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1937 pParty->days_played_without_rest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1938 pParty->pPlayers[3].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1939 pParty->pPlayers[2].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1940 pParty->pPlayers[1].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1941 pParty->pPlayers[0].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1942 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1943 case UIMSG_RestWindow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1944 DoThatMessageThing();
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1945 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1946 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1947 if (CheckActors_proximity())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1948 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1949 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1950 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1951 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1952 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1953 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1954 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1955 if (pParty->uFlags & 0x88)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1956 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1957 ShowStatusBarString(v88, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1958 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1959 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1960 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)13, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1961 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1962 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1963 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1964 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1965 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1966 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1967 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1968 if (!(pParty->uFlags & 0x88))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1969 {
2549
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
1970 pGUIWindow_CurrentMenu = new GUIWindow_Rest();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1971 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1972 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1973 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1974 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1975 ShowStatusBarString(pGlobalTXT_LocalizationStrings[478], 2);// "You can't rest in turn-based mode!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1976 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1977 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1978 v88 = pGlobalTXT_LocalizationStrings[480];// "There are hostile enemies near!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1979 if (pParty->uFlags & 0x88)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1980 v88 = pGlobalTXT_LocalizationStrings[479];// "You can't rest here!"
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1981 ShowStatusBarString(v88, 2);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1982 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1983 continue;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1984 pPlayers[uActiveCharacter]->PlaySound(SPEECH_CantRestHere, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1985 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1986 case UIMSG_Rest8Hour:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1987 if (_506F14_resting_stage != 0)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1988 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1989 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1990 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1991 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1992 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1993 if (pParty->uNumFoodRations < uRestUI_FoodRequiredToRest)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1994 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1995 ShowStatusBarString(pGlobalTXT_LocalizationStrings[482], 2);// "You don't have enough food to rest"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1996 if (uActiveCharacter && pPlayers[uActiveCharacter]->CanAct())
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
1997 pPlayers[uActiveCharacter]->PlaySound(SPEECH_108, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1998 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
1999 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2000 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2001 pParty->pPlayers[3].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2002 pParty->pPlayers[2].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2003 pParty->pPlayers[1].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2004 pParty->pPlayers[0].pConditions[Condition_Sleep] = pParty->uTimePlayed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2005 v90 = pMapStats->GetMapInfo(pCurrentMapName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2006 if (!v90)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2007 v90 = rand() % (signed int)pMapStats->uNumMaps + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2008 pMapInfo = &pMapStats->pInfos[v90];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2009 if (rand() % 100 + 1 <= pMapInfo->Encounter_percent)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2010 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2011 v91 = rand() % 100;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2012 v92 = pMapInfo->EncM1percent;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2013 v93 = v91 + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2014 if (v93 > v92)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2015 pNPCData4 = (NPCData *)((v93 > v92 + pMapInfo->EncM2percent) + 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2016 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2017 pNPCData4 = (NPCData *)1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2018 if (!_45063B_spawn_some_monster(pMapInfo, (int)pNPCData4))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2019 pNPCData4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2020 if (pNPCData4)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2021 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2022 pPlayerNum = rand() % 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2023 pParty->pPlayers[pPlayerNum].pConditions[Condition_Sleep] = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2024 v95 = rand();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2025 Rest(v95 % 6 + 60);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2026 _506F18_num_minutes_to_sleep = 0;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2027 _506F14_resting_stage = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2028
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2029 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2030 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2031 pAudioPlayer->PlaySound(SOUND_encounter, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2032 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2033 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2034 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2035 Party::TakeFood(uRestUI_FoodRequiredToRest);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2036 _506F18_num_minutes_to_sleep = 480;
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2037 _506F14_resting_stage = 2;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2038 pParty->RestAndHeal();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2039 pParty->days_played_without_rest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2040 pParty->pPlayers[3].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2041 pParty->pPlayers[2].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2042 pParty->pPlayers[1].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2043 pParty->pPlayers[0].SetAsleep(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2044 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2045 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2046 case UIMSG_AlreadyResting:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2047 if (_506F14_resting_stage == 2)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2048 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2049 ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2050 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2051 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2052 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2053 new OnButtonClick2(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0,
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2054 (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2055 v97 = _494820_training_time(pParty->uCurrentHour);
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2056 _506F14_resting_stage = 1;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2057 _506F18_num_minutes_to_sleep = 60 * v97 - pParty->uCurrentMinute;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2058 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2059 case UIMSG_HintSelectRemoveQuickSpellBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2060 if (quick_spell_at_page && byte_506550)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2061 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2062 v173 = pSpellStats->pInfos[quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2063 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[483], v173);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2064 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2065 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2066 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2067 if (pPlayers[uActiveCharacter]->uQuickSpell)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2068 v177 = pGlobalTXT_LocalizationStrings[584];// "Click here to remove your Quick Spell"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2069 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2070 v177 = pGlobalTXT_LocalizationStrings[484];// "Select a spell then click here to set a QuickSpell"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2071 strcpy(pTmpBuf.data(), v177);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2072 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2073 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2074 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2075 case UIMSG_SPellbook_ShowHightlightedSpellInfo:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2076 if (!uActiveCharacter || (uNumSeconds = (unsigned int)pPlayers[uActiveCharacter],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2077 !*(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + 6734) + uMessageParam + 402)))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2078 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2079 if (sub_4637E0_is_there_popup_onscreen())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2080 dword_507B00_spell_info_to_draw_in_popup = uMessageParam + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2081 v98 = *(char *)(uNumSeconds + 6734);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2082 if (quick_spell_at_page - 1 == uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2083 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2084 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2085 v161 = pGlobalTXT_LocalizationStrings[485];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2086 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2087 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2088 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2089 v178 = pSpellStats->pInfos[uMessageParam + 11 * v98 + 1].pName;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2090 v161 = pGlobalTXT_LocalizationStrings[486];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2091 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2092 sprintfex(pTmpBuf.data(), v161, v178);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2093 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2094 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2095 case UIMSG_ClickInstallRemoveQuickSpellBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2096 new OnButtonClick2(pBtn_InstallRemoveSpell->uX, pBtn_InstallRemoveSpell->uY, 0, 0, (int)pBtn_InstallRemoveSpell, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2097 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2098 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2099 pPlayer10 = pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2100 if (!byte_506550 || !quick_spell_at_page)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2101 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2102 pPlayer10->uQuickSpell = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2103 quick_spell_at_page = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2104 pAudioPlayer->PlaySound(SOUND_fizzle, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2105 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2106 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2107 pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2108 AA1058_PartyQuickSpellSound[uActiveCharacter - 1].AddPartySpellSound(pPlayers[uActiveCharacter]->uQuickSpell, uActiveCharacter);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2109 if (uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2110 pPlayer10->PlaySound(SPEECH_12, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2111 byte_506550 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2112 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2113 case UIMSG_SpellBook_PressTab://перелистывание страниц клавишей Tab
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2114 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2115 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2116 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2117 int skill_count = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2118 uAction = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2119 for (uint i = 0; i < 9; i++)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2120 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2121 if (pPlayers[uActiveCharacter]->pActiveSkills[PLAYER_SKILL_FIRE + i])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2122 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2123 if (pPlayers[uActiveCharacter]->lastOpenedSpellbookPage == i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2124 uAction = skill_count;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2125 v217[skill_count++] = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2126 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2127 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2128 if (!skill_count)//нет скиллов
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2129 pAudioPlayer->PlaySound((SoundID)(rand() % 2 + SOUND_TurnPageU), 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2130 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2131 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2132 if (GetAsyncKeyState(VK_SHIFT))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2133 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2134 --uAction;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2135 if (uAction < 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2136 uAction = skill_count - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2137 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2138 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2139 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2140 ++uAction;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2141 if (uAction >= skill_count)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2142 uAction = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2143 }
2549
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
2144 ((GUIWindow_Spellbook *)pGUIWindow_CurrentMenu)->OpenSpellbookPage(v217[uAction]);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2145 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2146 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2147 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2148 case UIMSG_OpenSpellbookPage:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2149 if (pTurnEngine->turn_stage == TE_MOVEMENT || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2150 continue;
2549
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
2151 ((GUIWindow_Spellbook *)pGUIWindow_CurrentMenu)->OpenSpellbookPage(uMessageParam);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2152 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2153 case UIMSG_SelectSpell:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2154 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2155 if (pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2156 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2157 if (!uActiveCharacter)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2158 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2159
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2160 // uNumSeconds = (unsigned int)pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2161 Player* player = pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2162 if (player->spellbook.pChapters[player->lastOpenedSpellbookPage].bIsSpellAvailable[uMessageParam])
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2163 //if ( *(char *)(uNumSeconds + 11 * *(char *)(uNumSeconds + &lastOpenedSpellbookPage) + uMessageParam + 402) )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2164 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2165 if (quick_spell_at_page - 1 == uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2166 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2167 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2168 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2169 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2170 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2171 pIcons_LOD->RemoveTexturesPackFromTextureList();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2172 v103 = quick_spell_at_page + 11 * player->lastOpenedSpellbookPage;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2173 /*if ( dword_50C9E8 < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2174 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2175 dword_50C9EC[3 * dword_50C9E8] = UIMSG_CastSpellFromBook;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2176 dword_50C9EC[3 * dword_50C9E8 + 1] = v103;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2177 dword_50C9EC[3 * dword_50C9E8 + 2] = uActiveCharacter - 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2178 ++dword_50C9E8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2179 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2180 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2181 // pMessageQueue_50CBD0->AddGUIMessage(UIMSG_CastSpellFromBook, v103, uActiveCharacter - 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2182 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2183 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2184 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2185 byte_506550 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2186 quick_spell_at_page = uMessageParam + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2187 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2188 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2189 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2190 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2191
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2192 case UIMSG_CastSpellFromBook:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2193 if (pTurnEngine->turn_stage != TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2194 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2195 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2196
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2197 case UIMSG_SpellScrollUse:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2198 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2199 if (pTurnEngine->turn_stage != TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2200 _42777D_CastSpell_UseWand_ShootArrow(uMessageParam, v199, 133, 1, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2201 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2202 case UIMSG_SpellBookWindow:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2203 if (pTurnEngine->turn_stage == TE_MOVEMENT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2204 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2205 if (bUnderwater == true)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2206 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2207 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2208 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2209 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2210 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2211 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2212 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2213 if (uActiveCharacter && !pPlayers[uActiveCharacter]->uTimeToRecovery)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2214 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2215 if (current_screen_type == SCREEN_GAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2216 {
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2217 new OnButtonClick2(476, 450, 0, 0, (int)pBtn_CastSpell, 0);
2549
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
2218 pGUIWindow_CurrentMenu = new GUIWindow_Spellbook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2219 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2220 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2221 if (current_screen_type != SCREEN_REST && current_screen_type != SCREEN_CHARACTERS
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2222 && (current_screen_type <= SCREEN_63 || current_screen_type > SCREEN_67))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2223 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2224 pGUIWindow_CurrentMenu->Release();
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2225 new OnButtonClick2(476, 450, 0, 0, (int)pBtn_CastSpell, 0);
2549
3121fb54a110 Rest & Spelbook refactored into class
a.parshin
parents: 2548
diff changeset
2226 pGUIWindow_CurrentMenu = new GUIWindow_Spellbook();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2227 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2228 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2229 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2230 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2231 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2232 case UIMSG_QuickReference:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2233 DoThatMessageThing();
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2234 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2235 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2236 ++pIcons_LOD->uTexturePacksCount;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2237 if (!pIcons_LOD->uNumPrevLoadedFiles)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2238 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2239 new OnButtonClick2(0x230u, 0x1C2u, 0, 0, (int)pBtn_QuickReference, 0);
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2240 viewparams->bRedrawGameUI = true;
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2241
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2242 pGUIWindow_CurrentMenu = new GUIWindow_QuickReference();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2243 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2244 case UIMSG_GameMenuButton:
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2245 if (current_screen_type != SCREEN_GAME)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2246 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2247 pGUIWindow_CurrentMenu->Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2248 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2249 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2250 viewparams->bRedrawGameUI = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2251 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2252
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2253 stru_506E40.Release();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2254 pRenderer->SaveScreenshot("gamma.pcx", 155, 117);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2255 stru_506E40.LoadPCXFile("gamma.pcx", 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2256
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2257 new OnButtonClick(0x25Au, 0x1C2u, 0, 0, (int)pBtn_GameSettings, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2258 //LABEL_453:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2259 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2260 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2261 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2262 //goto LABEL_770;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2263 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2264 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2265 ++pMessageQueue_50CBD0->uNumMessages;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2266 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2267 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2268 case UIMSG_ClickAwardScrollBar:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2269 books_page_number = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2270 if (pMouse->GetCursorPos(&v211)->y > 178)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2271 books_page_number = -1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2272 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2273 case UIMSG_ClickAwardsUpBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2274 new OnButtonClick3(pBtn_Up->uX, pBtn_Up->uY, 0, 0, (int)pBtn_Up, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2275 BtnUp_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2276 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2277 case UIMSG_ClickAwardsDownBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2278 new OnButtonClick3(pBtn_Down->uX, pBtn_Down->uY, 0, 0, (int)pBtn_Down, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2279 BtnDown_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2280 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2281 case UIMSG_ChangeDetaliz:
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2282 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ToggleRingsOverlay();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2283 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2284 case UIMSG_ClickPaperdoll:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2285 OnPaperdollLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2286 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2287 case UIMSG_SkillUp:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2288 pPlayer4 = pPlayers[uActiveCharacter];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2289 v105 = (int)&pPlayer4->pActiveSkills[uMessageParam];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2290 LOWORD(v2) = *(short *)v105;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2291 uNumSeconds = v2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2292 if (pPlayer4->uSkillPoints < (v2 & 0x3F) + 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2293 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2294 v87 = pGlobalTXT_LocalizationStrings[488];// "You don't have enough skill points!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2295 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2296 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2297 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2298 if ((uNumSeconds & 0x3F) < 0x3C)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2299 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2300 *(short *)v105 = uNumSeconds + 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2301 pPlayer4->uSkillPoints -= pPlayer4->pActiveSkills[uMessageParam] & 0x3F;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2302 pPlayer4->PlaySound(SPEECH_14, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2303 pAudioPlayer->PlaySound((SoundID)SOUND_quest, 0, 0, -1, 0, 0, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2304 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2305 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2306 v87 = pGlobalTXT_LocalizationStrings[487];// "You have already mastered this skill!"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2307 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2308 ShowStatusBarString(v87, 2);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2309 continue;
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2310 case UIMSG_ClickStatsBtn:
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2311 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowStatsTab();
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2312 continue;
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2313 case UIMSG_ClickSkillsBtn:
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2314 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowSkillsTab();
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2315 continue;
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2316 case UIMSG_ClickInventoryBtn:
2547
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2317 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowInventoryTab();
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2318 continue;
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2319 case UIMSG_ClickAwardsBtn:
fed97f15d1e1 * SaveLoad
a.parshin
parents: 2546
diff changeset
2320 ((GUIWindow_CharacterRecord *)pGUIWindow_CurrentMenu)->ShowAwardsTab();
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2321 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2322 case UIMSG_ClickExitCharacterWindowBtn:
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2323 new OnCancel2(pCharacterScreen_ExitBtn->uX, pCharacterScreen_ExitBtn->uY, 0, 0, (int)pCharacterScreen_ExitBtn, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2324 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2325 case UIMSG_ClickBooksBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2326 switch (uMessageParam)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2327 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2328 case 11://Page UP
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2329 BtnUp_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2330 pButton = pBtn_Book_2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2331 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2332 case 10://Page DOWN
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2333 BtnDown_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2334 pButton = pBtn_Book_1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2335 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2336 case 0://Zoom plus
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2337 pButton = pBtn_Book_1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2338 BtnDown_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2339 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2340 case 1://Zoom minus
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2341 pButton = pBtn_Book_2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2342 BtnUp_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2343 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2344 case 2://Potions
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2345 Book_PageBtn3_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2346 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2347 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2348 pButton = pBtn_Book_3;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2349 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2350 case 3://fountains
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2351 Book_PageBtn4_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2352 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2353 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2354 pButton = pBtn_Book_4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2355 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2356 case 4://obelisks
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2357 Book_PageBtn5_flag = 1;//Autonotes_Obelisks_page_flag
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2358 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2359 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2360 pButton = pBtn_Book_5;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2361 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2362 case 5://seer
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2363 Book_PageBtn6_flag = 1;//Autonotes_Seer_page_flag
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2364 if (dword_506364)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2365 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2366 pButton = pBtn_Book_6;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2367 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2368 case 6://misc
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2369 pButton = pBtn_Autonotes_Misc;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2370 Autonotes_Misc_page_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2371 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2372 case 7://Instructors
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2373 pButton = pBtn_Autonotes_Instructors;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2374 Autonotes_Instructors_page_flag = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2375 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2376 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2377 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2378 }
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2379 new OnButtonClick(pButton->uX, pButton->uY, 0, 0, (int)pButton, (char *)1);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2380 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2381 case UIMSG_SelectCharacter:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2382 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2383 GameUI_OnPlayerPortraitLeftClick(uMessageParam);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2384 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2385 case UIMSG_ShowStatus_Funds:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2386 v174 = (char *)pParty->uNumGoldInBank;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2387 //v158 = pParty->uNumGold + pParty->uNumGoldInBank;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2388 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[489], pParty->uNumGold + pParty->uNumGoldInBank, v174);// "You have %d total gold, %d in the Bank"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2389 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2390 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2391 case UIMSG_ShowStatus_DateTime:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2392 currHour = pParty->uCurrentHour;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2393 uNumSeconds = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2394 if (pParty->uCurrentHour > 12)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2395 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2396 if (pParty->uCurrentHour >= 24)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2397 uNumSeconds = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2398 currHour = (currHour - 12);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2399 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2400 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2401 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2402 if (pParty->uCurrentHour < 12) // 12:00 is PM
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2403 uNumSeconds = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2404 if (pParty->uCurrentHour == 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2405 currHour = 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2406 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2407 sprintf(pTmpBuf.data(), "%d:%02d%s %s %d %s %d", currHour, pParty->uCurrentMinute, aAMPMNames[uNumSeconds], aDayNames[pParty->uDaysPlayed % 7],
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2408 7 * pParty->uCurrentMonthWeek + pParty->uDaysPlayed % 7 + 1, aMonthNames[pParty->uCurrentMonth], pParty->uCurrentYear);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2409 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2410 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2411 case UIMSG_ShowStatus_Food:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2412 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], pParty->uNumFoodRations); // "You have %lu food"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2413 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2414 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2415 case UIMSG_ShowStatus_Player:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2416 pPlayer5 = pPlayers[uMessageParam];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2417 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pPlayer5->pName, pClassNames[pPlayer5->classType]);// "%s the %s"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2418 strcat(pTmpBuf.data(), ": ");
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2419 v107 = pPlayer5->GetMajorConditionIdx();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2420 strcat(pTmpBuf.data(), aCharacterConditionNames[v107]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2421 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2422 v108 = 8 * uMessageParam - 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2423 LOBYTE(v108) = v108 | 4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2424 pMouse->uPointingObjectID = PID(OBJECT_Player, v108);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2425 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2426 case UIMSG_ShowStatus_ManaHP:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2427 sprintf(pTmpBuf.data(), "%d / %d %s %d / %d %s", pPlayers[uMessageParam]->sHealth, pPlayers[uMessageParam]->GetMaxHealth(),
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2428 pGlobalTXT_LocalizationStrings[108], pPlayers[uMessageParam]->sMana, pPlayers[uMessageParam]->GetMaxMana(),
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2429 pGlobalTXT_LocalizationStrings[212]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2430 GameUI_SetFooterString(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2431 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2432 case UIMSG_CHEST_ClickItem:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2433 if (current_screen_type == SCREEN_CHEST_INVENTORY)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2434 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2435 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2436 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2437 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2438 Chest::OnChestLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2439 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2440 case UIMSG_InventoryLeftClick:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2441 pPlayers[uActiveCharacter]->OnInventoryLeftClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2442 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2443 case UIMSG_MouseLeftClickInGame:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2444 /*if ( !pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2445 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2446 if ( pMessageQueue_50CBD0->uNumMessages )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2447 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2448 OnGameViewportClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2449 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2450 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2451 v115 = pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2452 if (!pMessageQueue_50CBD0->uNumMessages)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2453 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2454 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2455 /*if ( (signed int)v115 < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2456 //goto LABEL_769;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2457 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2458 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2459 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2460 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2461 ++pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2462 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2463 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2464 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2465 else if (pMessageQueue_50CBD0->pMessages[0].field_8)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2466 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2467 pMessageQueue_50CBD0->uNumMessages = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2468 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2469 /*v115 = v0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2470 pMessageQueue_50CBD0->uNumMessages = v0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2471 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2472 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2473 //goto LABEL_771;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2474 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2475 ++pMessageQueue_50CBD0->uNumMessages;*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2476 }
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2477 else
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2478 {
2543
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2479 v115 = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2480 pMessageQueue_50CBD0->uNumMessages = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2481 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_MouseLeftClickInScreen, 0, 0);
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2482 /*if ( (signed int)v115 < 40 )
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2483 //goto LABEL_769;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2484 {
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2485 pMessageQueue_50CBD0->pMessages[v115].eType = UIMSG_MouseLeftClickInScreen;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2486 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2487 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2488 ++pMessageQueue_50CBD0->uNumMessages;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2489 continue;
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2490 }*/
b6140dfeac27 GameOver h/cpp
a.parshin
parents: 2542
diff changeset
2491 }
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2492 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2493 case UIMSG_MouseLeftClickInScreen://срабатывает при нажатии на правую кнопку мыши после UIMSG_MouseLeftClickInGame
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2494 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2495 OnGameViewportClick();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2496 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2497 case UIMSG_F:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2498 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2499 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2500 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2501 LOWORD(v116) = pEngine->pVisInstance->get_picked_object_zbuf_val();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2502 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2503 /*else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2504 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2505 uNumSeconds = (unsigned int)pMouse->GetCursorPos(&v209);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2506 pPoint3 = pMouse->GetCursorPos(&v204);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2507 v116 = pRenderer->pActiveZBuffer[*(int *)uNumSeconds + pSRZBufferLineOffsets[pPoint3->y]];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2508 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2509 pButton2 = (GUIButton *)(unsigned __int16)v116;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2510 __debugbreak();//GUIWindow::Create(0, 0, 0, 0, WINDOW_F, (int)pButton2, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2511 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2512 case UIMSG_54:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2513 __debugbreak();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2514 pButton2 = (GUIButton *)uMessageParam;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2515 __debugbreak();//GUIWindow::Create(0, 0, 0, 0, WINDOW_22, (int)pButton2, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2516 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2517 case UIMSG_Game_Action:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2518 DoThatMessageThing();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2519 OnPressSpace();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2520 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2521 case UIMSG_ClickZoomOutBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2522 if (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2523 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2524 pParty->uFlags |= 2u;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2525 new OnButtonClick2(519, 136, 0, 0, (int)pBtn_ZoomOut, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2526 uNumSeconds = 131072;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2527 v118 = 2 * viewparams->uMinimapZoom;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2528 ++viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2529 viewparams->uMinimapZoom *= 2;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2530 if (uCurrentlyLoadedLevelType != LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2531 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2532 if ((signed int)v118 > 4096)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2533 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2534 viewparams->uMinimapZoom = 4096;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2535 viewparams->field_28 = 12;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2536 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2537 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2538 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2539 v119 = 2048;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2540 if ((signed int)v118 <= 2048)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2541 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2542 _576E2C_current_minimap_zoom = v118;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2543 dword_576E28 = viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2544 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2545 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2546 viewparams->field_28 = 11;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2547 viewparams->uMinimapZoom = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2548 _576E2C_current_minimap_zoom = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2549 dword_576E28 = viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2550 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2551 case UIMSG_ClickZoomInBtn:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2552 if (current_screen_type)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2553 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2554 pParty->uFlags |= 2u;
2544
c674d547cc7c GUIWindow switch logic refactored into behaviour classes
a.parshin
parents: 2543
diff changeset
2555 new OnButtonClick2(574, 136, 0, 0, (int)pBtn_ZoomIn, 0);
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2556 uNumSeconds = 32768;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2557 v118 = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2558 --viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2559 viewparams->uMinimapZoom = (unsigned __int64)((signed __int64)(signed int)viewparams->uMinimapZoom << 15) >> 16;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2560 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2561 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2562 v119 = 512;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2563 if ((signed int)v118 < 512)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2564 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2565 viewparams->field_28 = 9;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2566 v118 = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2567 viewparams->uMinimapZoom = v119;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2568 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2569 _576E2C_current_minimap_zoom = v118;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2570 dword_576E28 = viewparams->field_28;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2571 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2572 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2573 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2574 if ((signed int)v118 < 256)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2575 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2576 viewparams->uMinimapZoom = 256;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2577 viewparams->field_28 = 8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2578 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2579 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2580 default:
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2581 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2582 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2583 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2584 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2585 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50C9E8->uNumMessages;//dword_50C9E8;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2586 memcpy(pMessageQueue_50CBD0->pMessages, pMessageQueue_50C9E8->pMessages, sizeof(GUIMessage) * pMessageQueue_50C9E8->uNumMessages);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2587 //memcpy(pMessageQueue_50CBD0->pMessages, dword_50C9EC, 12 * dword_50C9E8);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2588 //dword_50C9E8 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2589
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2590
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2591 pMessageQueue_50C9E8->uNumMessages = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2592 if (dword_50C9DC)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2593 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2594 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2595 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2596 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9DC;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2597 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = (int)ptr_50C9E0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2598 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2599 ++pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2600 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2601 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)dword_50C9DC, (int)ptr_50C9E0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2602 dword_50C9DC = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2603 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2604 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2605 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2606 if (_50C9D0_AfterEnchClickEventId > 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2607 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2608 _50C9D8_AfterEnchClickEventTimeout -= pEventTimer->uTimeElapsed;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2609 if (_50C9D8_AfterEnchClickEventTimeout <= 0)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2610 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2611 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2612 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2613 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)dword_50C9D0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2614 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = dword_50C9D4;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2615 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2616 ++pMessageQueue_50CBD0->uNumMessages;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2617 }*/
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2618 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)_50C9D0_AfterEnchClickEventId, _50C9D4_AfterEnchClickEventSecondParam, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2619 _50C9D0_AfterEnchClickEventId = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2620 _50C9D4_AfterEnchClickEventSecondParam = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2621 _50C9D8_AfterEnchClickEventTimeout = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2622 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2623 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2624 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2625 CastSpellInfoHelpers::_427E01_cast_spell();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2626 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2627
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2628
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2629
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2630
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2631
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2632 //----- (00463149) --------------------------------------------------------
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2633 void Game_Loop()
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2634 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2635 const char *pLocationName; // [sp-4h] [bp-68h]@74
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2636 bool bLoading; // [sp+10h] [bp-54h]@1
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2637 signed int v16; // [sp+14h] [bp-50h]@8
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2638 MSG Msg; // [sp+28h] [bp-3Ch]@20
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2639 char Source[64]; // [sp+44h] [bp-20h]@76
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2640
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2641 bLoading = sCurrentMenuID == MENU_LoadingProcInMainMenu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2642 SetCurrentMenuID((MENU_STATE)-1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2643 if (bLoading)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2644 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2645 pParty->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2646 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2647 LoadGame(uLoadGameUI_SelectedSlot);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2648 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2649
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2650 for (uint i = 1; i < 5; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2651 for (uint j = 1; j < 6; ++j)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2652 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2653 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2654 remove(pTmpBuf.data());
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2655 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2656
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2657 extern bool use_music_folder;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2658 LoadPlayerPortraintsAndVoices();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2659 pIcons_LOD->_inlined_sub1();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2660 if (use_music_folder)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2661 alSourcef(mSourceID, AL_GAIN, pSoundVolumeLevels[uMusicVolimeMultiplier]);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2662 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2663 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2664
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2665 while (2)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2666 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2667 v16 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2668 pMessageQueue_50CBD0->Flush();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2669
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2670 pPartyActionQueue->uNumActions = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2671 if (pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2672 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2673 pTurnEngine->End(false);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2674 pParty->bTurnBasedModeOn = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2675 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2676 DoPrepareWorld(bLoading, 1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2677 pEventTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2678 dword_6BE364_game_settings_1 |= GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2679 // uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2680 current_screen_type = SCREEN_GAME;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2681
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2682 //if ( pRenderer->pRenderD3D )
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2683 pEngine->pVisInstance->_4C1A02();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2684
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2685 bool game_finished = false;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2686 do
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2687 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2688 while (PeekMessageA(&Msg, 0, 0, 0, PM_REMOVE))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2689 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2690 if (Msg.message == WM_QUIT)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2691 Engine_DeinitializeAndTerminate(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2692 TranslateMessage(&Msg);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2693 DispatchMessageA(&Msg);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2694 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2695 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2696 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2697 WaitMessage();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2698 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2699 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2700 pEngine->_44EEA7();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2701 GameUI_WritePointedObjectStatusString();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2702 Keyboard::ProcessInputActions();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2703 Game_EventLoop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2704 if (pArcomageGame->bGameInProgress)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2705 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2706 ArcomageGame::Loop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2707 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2708 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2709 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2710
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2711 pMediaPlayer->HouseMovieLoop();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2712
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2713 pEventTimer->Update();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2714 pMiscTimer->Update();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2715
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2716 OnTimer(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2717 GameUI_StatusBar_UpdateTimedString(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2718 if (pMiscTimer->bPaused && !pEventTimer->bPaused)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2719 pMiscTimer->Resume();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2720 if (pEventTimer->bTackGameTime && !pParty->bTurnBasedModeOn)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2721 pEventTimer->bTackGameTime = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2722 if (!pEventTimer->bPaused && uGameState == GAME_STATE_PLAYING)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2723 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2724 if (!pEventTimer->bTackGameTime)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2725 _494035_timed_effects__water_walking_damage__etc();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2726
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2727 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0001)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2728 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0001;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2729 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2730 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2731 Actor::UpdateActorAI();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2732 UpdateUserInput_and_MapSpecificStuff();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2733 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2734 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2735 if (v16)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2736 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2737 v16 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2738 viewparams->bRedrawGameUI = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2739 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2740 pAudioPlayer->UpdateSounds();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2741 if ((signed int)uGameState == GAME_STATE_PLAYING)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2742 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2743 pEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2744 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2745 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2746 if (uGameState == GAME_FINISHED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2747 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2748 game_finished = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2749 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2750 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2751 if (uGameState == GAME_STATE_CHANGE_LOCATION)// смена локации
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2752 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2753 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2754 PrepareWorld(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2755 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2756 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2757 }
2563
65c97624c047 Saving & loading works from both main menu and game
a.parshin
parents: 2554
diff changeset
2758 //if ((signed int)uGameState <= GAME_STATE_5 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)//GAME_STATE_NEWGAME_OUT_GAMEMENU, GAME_STATE_LOADING_GAME
65c97624c047 Saving & loading works from both main menu and game
a.parshin
parents: 2554
diff changeset
2759 if (uGameState == GAME_STATE_LOADING_GAME
65c97624c047 Saving & loading works from both main menu and game
a.parshin
parents: 2554
diff changeset
2760 || uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU
65c97624c047 Saving & loading works from both main menu and game
a.parshin
parents: 2554
diff changeset
2761 || uGameState == GAME_STATE_5
65c97624c047 Saving & loading works from both main menu and game
a.parshin
parents: 2554
diff changeset
2762 || uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2763 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2764 game_finished = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2765 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2766 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2767 if (uGameState == GAME_STATE_FINAL_WINDOW)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2768 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2769 pRenderer->BeginScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2770 GUI_UpdateWindows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2771 pRenderer->EndScene();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2772 pRenderer->Present();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2773 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2774 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2775 if (uGameState != GAME_STATE_PARTY_DIED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2776 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2777 pEngine->Draw();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2778 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2779 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2780 if (uGameState == GAME_STATE_PARTY_DIED)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2781 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2782 pAudioPlayer->StopChannels(-1, -1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2783 memset(&pParty->pHirelings[0], 0, 0x4Cu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2784 memset(&pParty->pHirelings[1], 0, 0x4Cu);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2785 for (int i = 0; i < (signed int)pNPCStats->uNumNewNPCs; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2786 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2787 if (pNPCStats->pNewNPCData[i].field_24)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2788 pNPCStats->pNewNPCData[i].uFlags &= 0xFFFFFF7Fu;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2789 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2790 pMediaPlayer->bStopBeforeSchedule = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2791 pMediaPlayer->PlayFullscreenMovie(MOVIE_Death, true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2792 if (pMovie_Track)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2793 pMediaPlayer->Unload();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2794 SaveGame(0, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2795 ++pParty->uNumDeaths;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2796 for (uint i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2797 pParty->pPlayers[i].SetVariable(VAR_Award, 85);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2798 pParty->days_played_without_rest = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2799 pParty->uTimePlayed += 0x276000ui64;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2800 LOWORD(pParty->uFlags) &= ~0x204;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2801 pParty->SetGold(0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2802 pOtherOverlayList->Reset();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2803 memset(pParty->pPartyBuffs.data(), 0, 0x140u);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2804
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2805 if (pParty->bTurnBasedModeOn == 1)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2806 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2807 pTurnEngine->End(true);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2808 pParty->bTurnBasedModeOn = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2809 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2810 for (int i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2811 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2812 memset(pParty->pPlayers[i].pConditions.data(), 0, 0xA0u);//(pConditions, 0, 160)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2813 memset(pParty->pPlayers[i].pPlayerBuffs.data(), 0, 0x180u);//(pPlayerBuffs[0], 0, 384)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2814 pParty->pPlayers[i].sHealth = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2815 uActiveCharacter = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2816 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2817 if (_449B57_test_bit(pParty->_quest_bits, PARTY_QUEST_FINISHED_EMERALD_ISLE))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2818 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2819 pParty->vPosition.x = -17331; // respawn in harmondale
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2820 pParty->vPosition.y = 12547;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2821 pParty->vPosition.z = 465;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2822 pParty->sRotationY = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2823 pLocationName = "out02.odm";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2824 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2825 else
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2826 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2827 pParty->vPosition.x = 12552; // respawn on emerald isle
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2828 pParty->vPosition.y = 1816;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2829 pParty->vPosition.z = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2830 pParty->sRotationY = 512;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2831 pLocationName = "out01.odm";
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2832 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2833 strcpy(Source, pLocationName);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2834 pParty->uFallStartY = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2835 pParty->sRotationX = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2836 pParty->uFallSpeed = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2837 pParty->field_6E4 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2838 pParty->field_6E0 = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2839 if (_stricmp(Source, pCurrentMapName))
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2840 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2841 strcpy(pCurrentMapName, Source);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2842 _5B65A8_npcdata_uflags_or_other = pParty->vPosition.x;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2843 _5B65AC_npcdata_fame_or_other = pParty->vPosition.y;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2844 _5B65B0_npcdata_rep_or_other = pParty->vPosition.z;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2845 _5B65B4_npcdata_loword_house_or_other = pParty->sRotationY;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2846 _5B65B8_npcdata_hiword_house_or_other = pParty->sRotationX;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2847 dword_5B65C0 = 1;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2848 PrepareWorld(1);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2849 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2850 Actor::InitializeActors();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2851
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2852 int num_conscious_players = 0;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2853 int conscious_players_ids[4] = { -1, -1, -1, -1 };
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2854 for (int i = 0; i < 4; ++i)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2855 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2856 if (pParty->pPlayers[i].CanAct())
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2857 conscious_players_ids[num_conscious_players++] = i;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2858 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2859 if (num_conscious_players)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2860 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2861 int idx = conscious_players_ids[rand() % num_conscious_players];
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2862 Assert(idx >= 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2863 pParty->pPlayers[idx].PlaySound(SPEECH_99, 0);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2864 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2865
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2866 ShowStatusBarString(pGlobalTXT_LocalizationStrings[524], 2);// "Once again you've cheated death!.." "Вы снова обхитрили смерть! …"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2867 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2868 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2869 } while (!game_finished);
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2870
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2871 pEventTimer->Pause();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2872 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2873 if (uGameState == GAME_STATE_LOADING_GAME)
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2874 {
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2875 sub_491E3A();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2876 LoadPlayerPortraintsAndVoices();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2877 uGameState = GAME_STATE_PLAYING;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2878 pIcons_LOD->dword_11B84 = pIcons_LOD->uNumLoadedFiles;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2879 bLoading = true;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2880 continue;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2881 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2882 break;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2883 }
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2884 current_screen_type = SCREEN_VIDEO;
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2885 sub_491E3A();
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents:
diff changeset
2886 }