annotate Game/Game.cpp @ 2542:bacf9809126a

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