Mercurial > mm7
annotate UI/UIPopup.cpp @ 2481:4f4eb812af28
KEY_ALL_ACCESS
author | Ritor1 |
---|---|
date | Fri, 22 Aug 2014 17:41:25 +0600 |
parents | acac52e9e36a |
children | 5abd8fc8f1c6 |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2216
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
2355 | 6 #include "UIPopup.h" |
2349 | 7 #include "Books\UIMapBook.h" |
2350
7c10dfb6d802
Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents:
2349
diff
changeset
|
8 #include "UIShops.h" |
1299 | 9 #include "..\MM7.h" |
1298 | 10 |
1299 | 11 #include "..\Mouse.h" |
1298 | 12 |
1299 | 13 #include "..\Sprites.h" |
14 #include "..\Vis.h" | |
15 #include "..\Game.h" | |
16 #include "..\GUIWindow.h" | |
17 #include "..\GUIFont.h" | |
18 #include "..\Party.h" | |
19 #include "..\AudioPlayer.h" | |
20 #include "..\LOD.h" | |
21 #include "..\Actor.h" | |
22 #include "..\Viewport.h" | |
23 #include "..\SpriteObject.h" | |
24 #include "..\ObjectList.h" | |
25 #include "..\Chest.h" | |
26 #include "..\PaletteManager.h" | |
2044 | 27 #include "..\Timer.h" |
1299 | 28 #include "..\texts.h" |
1298 | 29 |
1299 | 30 #include "..\mm7_data.h" |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
31 #include "..\Events.h" |
1298 | 32 |
33 static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually | |
34 | |
1393 | 35 |
36 //----- (004179BC) -------------------------------------------------------- | |
1678 | 37 void CharacterUI_DrawTooltip(const char *Title, const char *content) |
1393 | 38 { |
1678 | 39 GUIWindow popup_window; // [sp+Ch] [bp-5Ch]@1 |
1393 | 40 POINT v6; // [sp+60h] [bp-8h]@1 |
41 | |
1678 | 42 memset(&popup_window, 0, 0x54u); |
43 popup_window.uFrameWidth = 384; | |
44 popup_window.uFrameHeight = 256; | |
45 popup_window.uFrameX = 128; | |
46 popup_window.uFrameY = pMouse->GetCursorPos(&v6)->y + 30; | |
47 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(content, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; | |
48 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
49 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
50 popup_window.DrawMessageBox(0); | |
51 | |
52 popup_window.uFrameX += 12; | |
53 popup_window.uFrameWidth -= 24; | |
54 popup_window.uFrameY += 12; | |
55 popup_window.uFrameHeight -= 12; | |
56 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; | |
57 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; | |
58 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, Title); | |
59 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); | |
60 popup_window.DrawText(pFontSmallnum, 1, LOBYTE(pFontLucida->uFontHeight), 0, content, 0, 0, 0); | |
1393 | 61 } |
62 | |
1298 | 63 //----- (004151D9) -------------------------------------------------------- |
64 void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight) | |
1678 | 65 { |
66 unsigned int uNumTiles; // [sp+2Ch] [bp-Ch]@6 | |
67 unsigned int coord_x; // [sp+2Ch] [bp-Ch]@3 | |
68 unsigned int coord_y; // [sp+34h] [bp-4h]@5 | |
1298 | 69 |
1678 | 70 pRenderer->SetTextureClipRect(uX, uY, uX + uWidth, uY + uHeight); |
71 if ( pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth && pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight) | |
72 { | |
73 uNumTiles = uWidth / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; | |
74 if ( uWidth % pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth ) | |
75 ++uNumTiles; | |
76 coord_y = uY; | |
77 for ( uint j = 0; j <= uHeight / pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight; j++ ) | |
1298 | 78 { |
1678 | 79 coord_x = uX - pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; |
80 for ( uint i = uNumTiles + 1; i; --i ) | |
81 { | |
82 coord_x += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureWidth; | |
83 pRenderer->DrawTextureIndexed(coord_x, coord_y, pIcons_LOD->GetTexture(uTextureID_Parchment)); | |
84 } | |
85 coord_y += pIcons_LOD->GetTexture(uTextureID_Parchment)->uTextureHeight; | |
1298 | 86 } |
1678 | 87 pRenderer->DrawTextureTransparent(uX, uY, pIcons_LOD->GetTexture(uTextureID_5076AC)); |
88 pRenderer->DrawTextureTransparent(uX, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B4)); | |
89 pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY, pIcons_LOD->GetTexture(uTextureID_5076A8)); | |
90 pRenderer->DrawTextureTransparent(uX + uWidth - 32, uY + uHeight - 32, pIcons_LOD->GetTexture(uTextureID_5076B0)); | |
91 if ( uWidth > 64 ) | |
92 { | |
93 pRenderer->SetTextureClipRect(uX + 32, uY, uX + uWidth - 32, uY + uHeight); | |
94 pRenderer->DrawTextureTransparent(uX + 32, uY, pIcons_LOD->GetTexture(uTextureID_507698)); | |
95 pRenderer->DrawTextureTransparent(uX + 32, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4)); | |
96 if ( uWidth > 512 ) | |
97 { | |
98 pRenderer->DrawTextureTransparent(uX + 544, uY, pIcons_LOD->GetTexture(uTextureID_507698)); | |
99 pRenderer->DrawTextureTransparent(uX + 544, uY + uHeight - 10, pIcons_LOD->GetTexture(uTextureID_5076A4)); | |
100 } | |
101 } | |
102 if ( uHeight > 64 ) | |
103 { | |
104 pRenderer->SetTextureClipRect(uX, uY + 32, uX + uWidth, uY + uHeight - 32); | |
105 pRenderer->DrawTextureTransparent(uX, uY + 32, pIcons_LOD->GetTexture(uTextureID_5076A0)); | |
106 pRenderer->DrawTextureTransparent(uX + uWidth - 10, uY + 32, pIcons_LOD->GetTexture(uTextureID_50769C)); | |
107 } | |
108 pRenderer->ResetTextureClipRect(); | |
109 } | |
110 } | |
1298 | 111 |
112 //----- (0041D895) -------------------------------------------------------- | |
113 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) | |
1699 | 114 { |
1705 | 115 unsigned int v2; // eax@3 |
116 const char *v28; // edi@69 | |
117 int v34; // esi@81 | |
1838 | 118 const char *pText; // [sp-14h] [bp-28Ch]@110 |
1705 | 119 char out_text[300]; // [sp+8h] [bp-270h]@40 |
120 char v65[120]; // [sp+134h] [bp-144h]@92 | |
121 stru351_summoned_item v67; | |
122 int v77; // [sp+200h] [bp-78h]@12 | |
123 int v78; // [sp+204h] [bp-74h]@5 | |
124 GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2 | |
125 POINT a2; // [sp+25Ch] [bp-1Ch]@2 | |
126 int v81; // [sp+264h] [bp-14h]@5 | |
127 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 | |
128 char* v84; | |
129 int v85; | |
130 char *Str; // [sp+270h] [bp-8h]@65 | |
1298 | 131 |
2132 | 132 int r_mask = 0xF800; |
133 int g_mask = 0x7E0; | |
134 int b_mask = 0x1F; | |
135 | |
1699 | 136 if (!inspect_item->uItemID) |
137 return; | |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
138 iteminfo_window.Hint = nullptr; |
1699 | 139 iteminfo_window.uFrameWidth = 384; |
140 iteminfo_window.uFrameHeight = 180; | |
141 iteminfo_window.uFrameY = 40; | |
142 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | |
143 v2 = pMouse->GetCursorPos(&a2)->x + 30; | |
144 else | |
145 v2 = pMouse->GetCursorPos(&a2)->x - iteminfo_window.uFrameWidth - 30; | |
146 iteminfo_window.uFrameX = v2; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
147 v78 = 100 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureWidth; |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
148 v81 = 144 - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight; |
1699 | 149 if ( v78 > 0 ) |
150 v78 = v78 / 2; | |
151 if ( v81 <= 0 ) | |
152 v81 = 0; | |
153 else | |
154 v81 = v81 / 2; | |
155 if ( !pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St ) | |
156 inspect_item->SetIdentified(); | |
157 v77 = 0; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
158 if (inspect_item->GetItemEquipType() == EQUIP_GOLD) |
1699 | 159 v77 = inspect_item->uSpecEnchantmentType; |
160 if ( uActiveCharacter ) | |
161 { | |
162 //try to identify | |
163 if (!inspect_item->IsIdentified()) | |
164 { | |
165 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) | |
1298 | 166 inspect_item->SetIdentified(); |
1699 | 167 v83 = SPEECH_9; |
168 if ( !inspect_item->IsIdentified() ) | |
169 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2);//"Identify Failed" | |
170 else | |
171 { | |
172 v83 = SPEECH_8; | |
173 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) | |
174 v83 = SPEECH_7; | |
175 } | |
176 if ( dword_4E455C ) | |
177 { | |
178 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); | |
179 dword_4E455C = 0; | |
180 } | |
181 } | |
182 inspect_item->UpdateTempBonus(pParty->uTimePlayed); | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1545
diff
changeset
|
183 if (inspect_item->IsBroken()) |
1699 | 184 { |
185 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) | |
186 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; | |
187 v83 = SPEECH_11; | |
188 if ( !inspect_item->IsBroken() ) | |
189 v83 = SPEECH_10; | |
190 else | |
191 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2);//"Repair Failed" | |
192 if ( dword_4E455C ) | |
193 { | |
194 pPlayers[uActiveCharacter]->PlaySound(v83, 0); | |
195 dword_4E455C = 0; | |
196 } | |
197 } | |
198 } | |
199 if (inspect_item->IsBroken()) | |
200 { | |
201 iteminfo_window.DrawMessageBox(0); | |
202 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
203 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, | |
204 iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
205 iteminfo_window.uFrameWidth -= 24; | |
206 iteminfo_window.uFrameHeight -= 12; | |
207 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
208 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
209 pRenderer->DrawTransparentRedShade(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
1699 | 210 if ( inspect_item->IsIdentified()) |
211 pText = (char *)inspect_item->GetIdentifiedName(); | |
212 else | |
213 pText = pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName; | |
2069 | 214 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pText, 3); |
1699 | 215 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &iteminfo_window, 0, 0) / 2, |
2069 | 216 Color16(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" |
1699 | 217 pRenderer->ResetTextureClipRect(); |
218 if ( !areWeLoadingTexture ) | |
219 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
220 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 221 pIcons_LOD->SyncLoadedFilesCount(); |
222 } | |
223 return; | |
224 } | |
225 if (!inspect_item->IsIdentified()) | |
226 { | |
227 iteminfo_window.DrawMessageBox(0); | |
228 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
229 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
230 iteminfo_window.uFrameWidth -= 24; | |
231 iteminfo_window.uFrameHeight -= 12; | |
232 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
233 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
234 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, v81 + iteminfo_window.uFrameY + 30, pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
2069 | 235 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3); |
1699 | 236 iteminfo_window.DrawTitleText(pFontArrus, 0x64u, ((signed int)iteminfo_window.uFrameHeight >> 1) - pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &iteminfo_window, 0, 0) / 2, |
2069 | 237 Color16(0xFFu, 0x19u, 0x19u), pGlobalTXT_LocalizationStrings[232], 3);//"Not Identified" |
1699 | 238 pRenderer->ResetTextureClipRect(); |
239 if ( !areWeLoadingTexture ) | |
240 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
241 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 242 pIcons_LOD->SyncLoadedFilesCount(); |
243 } | |
244 return; | |
245 } | |
246 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName); //"Type: %s" | |
247 out_text[100] = 0; | |
248 out_text[200] = 0; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
249 switch (inspect_item->GetItemEquipType()) |
1699 | 250 { |
1989 | 251 case EQUIP_SINGLE_HANDED: |
252 case EQUIP_TWO_HANDED: | |
1699 | 253 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
254 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
255 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); //"Damage" |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
256 if (inspect_item->GetDamageMod()) |
1699 | 257 { |
258 char mod[16]; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
259 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); |
1699 | 260 strcat(out_text + 100, mod); |
261 } | |
262 break; | |
1298 | 263 |
264 case EQUIP_BOW: | |
1699 | 265 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
266 (int)inspect_item->GetDamageMod(), pGlobalTXT_LocalizationStrings[53], //"Damage" |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
267 (int)inspect_item->GetDamageDice(), (int)inspect_item->GetDamageRoll()); |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
268 if (inspect_item->GetDamageMod()) |
1699 | 269 { |
270 char mod[16]; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
271 sprintf(mod, "+%d", (int)inspect_item->GetDamageMod()); |
1699 | 272 strcat(out_text + 100, mod); |
273 } | |
274 break; | |
1298 | 275 |
276 case EQUIP_ARMOUR: | |
277 case EQUIP_SHIELD: | |
278 case EQUIP_HELMET: | |
279 case EQUIP_BELT: | |
280 case EQUIP_CLOAK: | |
281 case EQUIP_GAUNTLETS: | |
282 case EQUIP_BOOTS: | |
283 case EQUIP_RING: | |
284 case EQUIP_AMULET: | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
285 if (inspect_item->GetDamageDice()) //"Armor" |
1699 | 286 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
287 inspect_item->GetDamageDice() + inspect_item->GetDamageMod()); |
1699 | 288 break; |
289 } | |
1298 | 290 |
1699 | 291 if ( !v77 ) |
292 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
293 if (inspect_item->GetItemEquipType() ==EQUIP_POTION) //this is CORRECT! do not move to switch! |
1699 | 294 { |
295 if ( inspect_item->uEnchantmentType ) | |
296 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" | |
297 } | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
298 else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT) |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
299 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], inspect_item->GetDamageDice()); //"Power" |
1699 | 300 else if ( inspect_item->uEnchantmentType ) |
301 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->m_enchantmentStrength); //"Special" | |
302 else if ( inspect_item->uSpecEnchantmentType ) | |
2195 | 303 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement); |
1699 | 304 else if ( inspect_item->uNumCharges ) |
305 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" | |
306 } | |
307 iteminfo_window.uFrameWidth -= 12; | |
308 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
309 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
310 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
311 v84 = &out_text[0]; | |
312 for ( uint i = 1; i <= 3; i++ ) | |
313 { | |
314 if ( *v84 ) | |
315 Str += pFontComic->CalcTextHeight(v84, &iteminfo_window, 100, 0) + 3; | |
316 v84 += 100; | |
317 } | |
318 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
319 if ( *v28 ) | |
320 Str += pFontSmallnum->CalcTextHeight(pItemsTable->pItems[inspect_item->uItemID].pDescription, &iteminfo_window, 100, 0); | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
321 iteminfo_window.uFrameHeight = pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), |
1699 | 322 TEXTURE_16BIT_PALETTE)->uTextureHeight + v81 + 54; |
323 if ( (signed int)Str > (signed int)iteminfo_window.uFrameHeight ) | |
324 iteminfo_window.uFrameHeight = (unsigned int)Str; | |
2092 | 325 if ( inspect_item->uAttributes & ITEM_TEMP_BONUS && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) |
1699 | 326 iteminfo_window.uFrameHeight += LOBYTE(pFontComic->uFontHeight); |
327 v85 = 0; | |
328 if ( pFontArrus->uFontHeight ) | |
329 { | |
330 iteminfo_window.uFrameWidth -= 24; | |
331 if ( pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(), &iteminfo_window, 0, 0) / (signed int)pFontArrus->uFontHeight ) | |
332 v85 = pFontArrus->uFontHeight; | |
333 iteminfo_window.uFrameWidth += 24; | |
334 } | |
335 iteminfo_window.uFrameWidth += 12; | |
336 iteminfo_window.uFrameHeight += (unsigned int)v85; | |
337 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
338 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
339 iteminfo_window.DrawMessageBox(0); | |
340 pRenderer->SetTextureClipRect(iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12, | |
341 iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12, iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12); | |
342 iteminfo_window.uFrameWidth -= 12; | |
343 iteminfo_window.uFrameHeight -= 12; | |
344 iteminfo_window.uFrameZ = iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1; | |
345 iteminfo_window.uFrameW = iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1; | |
346 pRenderer->DrawTextureTransparent(iteminfo_window.uFrameX + v78, | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
347 iteminfo_window.uFrameY + (signed int)(iteminfo_window.uFrameHeight - pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->uTextureHeight) / 2, |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
348 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)); |
1298 | 349 |
1699 | 350 v34 = (int)(v85 + 35); |
351 Str = out_text; | |
352 for ( uint i = 1; i <= 3; i++ ) | |
353 { | |
354 if ( *Str ) | |
355 { | |
356 iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); | |
357 v34 += pFontComic->CalcTextHeight(Str, &iteminfo_window, 100, 0) + 3; | |
1298 | 358 } |
1699 | 359 Str += 100; |
360 } | |
361 v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription; | |
362 if ( *v28 ) | |
363 iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0); | |
364 iteminfo_window.uFrameX += 12; | |
365 iteminfo_window.uFrameWidth -= 24; | |
2069 | 366 iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), inspect_item->GetIdentifiedName(), 3); |
1699 | 367 iteminfo_window.uFrameWidth += 24; |
368 iteminfo_window.uFrameX -= 12; | |
369 if ( v77 ) | |
370 { | |
371 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" | |
372 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
373 pRenderer->ResetTextureClipRect(); | |
374 } | |
375 else | |
376 { | |
2092 | 377 if ( (inspect_item->uAttributes & ITEM_TEMP_BONUS) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) |
1699 | 378 { |
379 init_summoned_item(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); | |
380 strcpy(pTmpBuf.data(), "Duration:"); | |
381 Str = (char *)(v67.field_18_expire_year - game_starting_year); | |
382 if (v67.field_18_expire_year != 1168 ) | |
383 { | |
384 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); | |
385 strcat(pTmpBuf.data(), v65); | |
386 } | |
387 if ( (((v67.field_14_exprie_month || Str) && | |
388 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str) | |
389 || v67.field_C_expire_day) | |
390 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
391 v67.field_C_expire_day) | |
392 || v67.field_8_expire_hour) | |
393 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf.data(), v65), v67.field_14_exprie_month) || Str || | |
394 v67.field_C_expire_day || v67.field_8_expire_hour) | |
395 || v67.field_4_expire_minute ) | |
396 { | |
397 sprintf(v65, " %d:mn", v67.field_4_expire_minute); | |
398 strcat(pTmpBuf.data(), v65); | |
399 } | |
400 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
401 } | |
402 sprintf(pTmpBuf.data(), "%s: %lu", pGlobalTXT_LocalizationStrings[465], inspect_item->GetValue()); | |
403 iteminfo_window.DrawText(pFontComic, 100, iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf.data(), 0, 0, 0); | |
2092 | 404 if ( inspect_item->uAttributes & ITEM_STOLEN ) |
1699 | 405 pText = pGlobalTXT_LocalizationStrings[187]; //"Stolen" |
406 else | |
407 { | |
2092 | 408 if ( !(inspect_item->uAttributes & ITEM_HARDENED) ) |
1699 | 409 { |
410 pRenderer->ResetTextureClipRect(); | |
411 if ( !areWeLoadingTexture ) | |
412 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
413 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 414 pIcons_LOD->SyncLoadedFilesCount(); |
415 } | |
416 return; | |
417 } | |
418 pText = pGlobalTXT_LocalizationStrings[651]; //"Hardened" | |
419 } | |
2132 | 420 LOWORD(inspect_item->uAttributes) = r_mask; |
1699 | 421 iteminfo_window.DrawText(pFontComic, pFontComic->GetLineWidth(pTmpBuf.data()) + 132, |
422 iteminfo_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight), inspect_item->uAttributes, pText, 0, 0, 0); | |
423 pRenderer->ResetTextureClipRect(); | |
424 } | |
425 if ( !areWeLoadingTexture ) | |
426 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1699
diff
changeset
|
427 pIcons_LOD->LoadTexturePtr(inspect_item->GetIconName(), TEXTURE_16BIT_PALETTE)->Release(); |
1699 | 428 pIcons_LOD->SyncLoadedFilesCount(); |
429 } | |
430 return; | |
431 } | |
1298 | 432 // 4E455C: using guessed type int dword_4E455C; |
433 // 506128: using guessed type int areWeLoadingTexture; | |
434 | |
435 //----- (0041E360) -------------------------------------------------------- | |
2216 | 436 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *pWindow) |
1298 | 437 { |
438 unsigned __int16 v9; // dx@4 | |
439 SpriteFrame *v10; // edi@17 | |
440 unsigned int v18; // ecx@19 | |
441 unsigned int v19; // eax@21 | |
1720 | 442 int skill_points; // edi@61 |
443 unsigned int skill_level; // eax@61 | |
1705 | 444 int pTextHeight; // edi@90 |
1720 | 445 PlayerSpeech speech; // [sp-8h] [bp-1F4h]@79 |
1298 | 446 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 |
447 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
2475
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
448 RECT dest_rect; // [sp+ECh] [bp-100h]@26 |
1838 | 449 const char *string_name[10]; // [sp+FCh] [bp-F0h]@145 |
450 const char *content[11]; // [sp+124h] [bp-C8h]@127 | |
2195 | 451 unsigned char resistances[11]; // [sp+124h] [bp-C8h]@127 |
1298 | 452 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 |
453 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
1720 | 454 bool for_effects; // [sp+1C0h] [bp-2Ch]@3 |
1705 | 455 bool normal_level; // [sp+1D0h] [bp-1Ch]@18 |
456 bool expert_level; // [sp+1C4h] [bp-28h]@18 | |
457 bool master_level; // [sp+1C8h] [bp-24h]@18 | |
458 bool grandmaster_level; // [sp+1B4h] [bp-38h]@3 | |
1838 | 459 const char *pText; // [sp+1D4h] [bp-18h]@18 |
1705 | 460 int pTextColorID; // [sp+1E4h] [bp-8h]@18 |
1720 | 461 int v115; |
1298 | 462 |
1720 | 463 bool monster_full_informations = false; |
1298 | 464 static Actor pMonsterInfoUI_Doll; |
2059 | 465 if ( !uActiveCharacter ) // |
466 uActiveCharacter = 1; | |
467 | |
1298 | 468 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) |
469 { | |
470 bMonsterInfoUI_bDollInitialized |= 1u; | |
471 Actor::Actor(&pMonsterInfoUI_Doll); | |
472 atexit(nullsub_3); | |
473 }*/ | |
2002 | 474 v106.sParentBillboardID = -1; |
1699 | 475 v115 = monster_popup_y_offsets[((signed __int16)pActors[uActorID].pMonsterInfo.uID - 1) / 3] - 40; |
476 if ( pActors[uActorID].pMonsterInfo.uID == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
1298 | 477 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; |
478 else | |
479 { | |
1699 | 480 memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID], sizeof(pMonsterInfoUI_Doll)); |
1298 | 481 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
482 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
2093 | 483 v9 = rand() % 256 + 128; |
484 pMonsterInfoUI_Doll.uCurrentActionLength = v9; | |
1298 | 485 } |
486 | |
487 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
488 { | |
489 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
490 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) | |
491 { | |
492 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
493 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; | |
494 } | |
495 else | |
496 { | |
497 //rand(); | |
498 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; | |
499 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) && | |
500 (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) && rand() % 30 < 100 ) | |
501 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; | |
1699 | 502 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[pActors[uActorID].pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; |
1298 | 503 } |
504 } | |
1699 | 505 v10 = pSpriteFrameTable->GetFrame( pActors[uActorID].pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); |
1298 | 506 v106.pTarget = pRenderer->pTargetSurface; |
507 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
508 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
2216 | 509 v106.uViewportX = pWindow->uFrameX + 13; |
510 v106.uViewportY = pWindow->uFrameY + 52; | |
511 v106.uViewportW = (pWindow->uFrameY + 52) + 128; | |
1298 | 512 v106.uViewportZ = v106.uViewportX + 128; |
513 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; | |
514 v106._screenspace_x_scaler_packedfloat = 65536; | |
515 v106._screenspace_y_scaler_packedfloat = 65536; | |
2216 | 516 v106.uScreenSpaceY = v115 + (pWindow->uFrameY + 52) + pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].uHeight; |
1298 | 517 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
518 v106.sZValue = 0; | |
519 v106.uFlags = 0; | |
2216 | 520 pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1); |
2093 | 521 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, Color16(0xE1u, 255, 0x9Bu));//ãîðèçîíòàëüíàÿ âåðõíÿÿ ëèíèÿ |
522 pRenderer->RasterLine2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, Color16(0xE1u, 255, 0x9Bu));//ãîðèçîíòàëüíàÿ íèæíÿÿ ëèíèÿ | |
523 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, Color16(0xE1u, 255, 0x9Bu));//ëåâàÿ âåðòèêàëüíàÿ ëèíèÿ | |
524 pRenderer->RasterLine2D(v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, Color16(0xE1u, 255, 0x9Bu));//ïðàâàÿ âåðòèêàëüíàÿ ëèíèÿ | |
2155 | 525 //if ( pRenderer->pRenderD3D ) |
1298 | 526 { |
1699 | 527 v106.uScreenSpaceY = v115 + v106.uViewportY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; |
2475
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
528 |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
529 memset(&Dst, 0, sizeof(Dst)); |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
530 Dst.dwSize = sizeof(Dst); |
1298 | 531 Dst.dwFillColor = 0; |
2475
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
532 |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
533 memset(&pDesc, 0, sizeof(pDesc)); |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
534 pDesc.dwSize = sizeof(pDesc); |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
535 |
1699 | 536 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->GetSurfaceDesc(&pDesc); |
1298 | 537 v107 = 0; |
1705 | 538 uint i = 0; |
1699 | 539 int dst_x = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2; |
540 int dst_y = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
541 uint dst_z = v106.uScreenSpaceX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaX + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth / 2 - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferWidth; | |
542 uint dst_w = v106.uScreenSpaceY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaY + pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight - pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uBufferHeight; | |
1298 | 543 if (dst_x < v106.uViewportX) |
544 { | |
545 v18 = v106.uViewportX - dst_x; | |
546 dst_x = v106.uViewportX; | |
547 v107 = v18; | |
548 } | |
549 if (dst_y < v106.uViewportY) | |
550 { | |
551 v19 = v106.uViewportY - dst_y; | |
552 dst_y = v106.uViewportY; | |
553 i = v19; | |
554 } | |
555 if (dst_z > v106.uViewportZ) | |
556 dst_z = v106.uViewportZ; | |
557 if (dst_w > v106.uViewportW) | |
558 dst_w = v106.uViewportW; | |
2155 | 559 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0x7FF); |
560 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0x7FF); | |
2475
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
561 dest_rect.left = v106.uViewportX; |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
562 dest_rect.top = v106.uViewportY; |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
563 dest_rect.right = v106.uViewportZ; |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
564 dest_rect.bottom = v106.uViewportW; |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
565 |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
566 ErrD3D(pRenderer->pBackBuffer4->Blt(&dest_rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &Dst)); |
2155 | 567 /*if ( pRenderer->uTargetGBits == 5 ) |
1298 | 568 { |
2069 | 569 __debugbreak(); // no monster popup for r5g5b5 will be |
1298 | 570 memset(&pDesc, 0, 0x7Cu); |
571 pDesc.dwSize = 124; | |
1699 | 572 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT)) |
573 { | |
574 v20 = (char *)dst_y; | |
575 v110 = pDesc.lpSurface; | |
576 if (dst_y < dst_w) | |
577 { | |
578 v21 = dst_x; | |
2069 | 579 //v22 = &pRenderer->pTargetSurface[dst_y * pRenderer->uTargetSurfacePitch + dst_x]; |
1980 | 580 ushort* _v22_2 = v22; |
1699 | 581 v23 = i - dst_y; |
582 v115 = i - dst_y; | |
583 while ( 1 ) | |
584 { | |
585 dst_y = v21; | |
586 if ( v21 < dst_z ) | |
587 { | |
588 v25 = v107 - v21; | |
589 v109 = (int)&v20[v23]; | |
590 for ( i = v107 - v21; ; v25 = i ) | |
591 { | |
592 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight); | |
593 v26 = (char *)v108 + pDesc.dwWidth * (v25 + dst_y++) / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
594 *v22 = *((short *)v110 + (int)v26); | |
595 ++v22; | |
596 if ( dst_y >= dst_z ) | |
597 break; | |
598 } | |
599 v23 = v115; | |
600 } | |
601 v22 = (unsigned __int16 *)((char *)_v22_2 + 2 * pRenderer->uTargetSurfacePitch); | |
602 _v22_2 = v22; | |
603 v20 = (char *)(dst_y + 1); | |
604 v28 = __OFSUB__(dst_y + 1, dst_w); | |
605 v27 = (signed int)(dst_y++ + 1 - dst_w) < 0; | |
606 if ( !(v27 ^ v28) ) | |
607 break; | |
608 v21 = dst_x; | |
609 } | |
610 } | |
611 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(0); | |
612 } | |
1298 | 613 } |
2155 | 614 else*/ |
1699 | 615 { |
2475
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
616 memset(&pDesc, 0, sizeof(pDesc)); |
acac52e9e36a
remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents:
2464
diff
changeset
|
617 pDesc.dwSize = sizeof(pDesc); |
1699 | 618 if ( pRenderer->LockSurface_DDraw4(pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface, &pDesc, DDLOCK_WAIT) ) |
619 { | |
1980 | 620 ushort* src = (unsigned __int16 *)pDesc.lpSurface; |
1699 | 621 uint num_top_scanlines_above_frame_y = i - dst_y; |
622 for (uint y = dst_y; y < dst_w; ++y) | |
623 { | |
2069 | 624 //ushort* dst = &pRenderer->pTargetSurface[y * pRenderer->uTargetSurfacePitch + dst_x]; |
1298 | 625 |
1699 | 626 uint src_y = num_top_scanlines_above_frame_y + y; |
627 for (uint x = dst_x; x < dst_z; ++x) | |
628 { | |
629 uint src_x = v107 - dst_x + x; // num scanlines left to frame_x + current x | |
1298 | 630 |
1699 | 631 uint idx = pDesc.dwHeight * src_y / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaHeight * (pDesc.lPitch / sizeof(short)) + |
632 pDesc.dwWidth * src_x / pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].uAreaWidth; | |
633 uint b = src[idx] & 0x1F; | |
2069 | 634 //*dst++ = b | 2 * (src[idx] & 0xFFE0); |
2093 | 635 pRenderer->WritePixel16(x, y, b | 2 * (src[idx] & 0xFFE0)); |
1699 | 636 } |
637 } | |
2461 | 638 pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]].pTextureSurface->Unlock(NULL); |
1699 | 639 } |
640 } | |
1298 | 641 } |
2155 | 642 /*else |
1298 | 643 { |
644 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); | |
1699 | 645 if ( v10->pHwSpriteIDs[0] >= 0 ) |
646 pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]].DrawSprite_sw(&v106, 0); | |
2155 | 647 }*/ |
1705 | 648 //name and profession |
1699 | 649 if ( pActors[uActorID].sNPC_ID ) |
1298 | 650 { |
1699 | 651 if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession) |
652 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], GetNPCData(pActors[uActorID].sNPC_ID)->pName, aNPCProfessionNames[GetNPCData(pActors[uActorID].sNPC_ID)->uProfession]); // "%s the %s" / ^Pi[%s] %s | |
653 else | |
1705 | 654 strncpy(pTmpBuf.data(), GetNPCData(pActors[uActorID].sNPC_ID)->pName, 2000); |
1298 | 655 } |
656 else | |
657 { | |
1699 | 658 if ( pActors[uActorID].dword_000334_unique_name ) |
1705 | 659 strncpy(pTmpBuf.data(), pMonsterStats->pPlaceStrings[pActors[uActorID].dword_000334_unique_name], 2000); |
1298 | 660 else |
1705 | 661 strncpy(pTmpBuf.data(), pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName, 2000); |
1298 | 662 } |
2216 | 663 pWindow->DrawTitleText(pFontComic, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3); |
1705 | 664 //health bar |
2216 | 665 Actor::DrawHealthBar(&pActors[uActorID], pWindow); |
1705 | 666 |
667 normal_level = 0; | |
668 expert_level = 0; | |
669 master_level = 0; | |
670 grandmaster_level = 0; | |
1720 | 671 for_effects = 0; |
1298 | 672 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; |
1720 | 673 if ( pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) ) |
1298 | 674 { |
1720 | 675 skill_points = (unsigned __int8)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) & 0x3F; |
676 skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) - 1; | |
677 if ( skill_level == 0 )//(normal) | |
1699 | 678 { |
1720 | 679 if ( skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) |
680 normal_level = 1; | |
681 } | |
682 else if ( skill_level == 1 )//(expert) | |
683 { | |
684 if ( 2 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) | |
1699 | 685 { |
1720 | 686 normal_level = 1; |
687 expert_level = 1; | |
1699 | 688 } |
689 } | |
1720 | 690 else if ( skill_level == 2 )//(master) |
1699 | 691 { |
1720 | 692 if ( 3 * skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel ) |
1699 | 693 { |
1720 | 694 normal_level = 1; |
695 expert_level = 1; | |
696 master_level = 1; | |
1699 | 697 } |
1720 | 698 } |
699 else if ( skill_level == 3 )//grandmaster | |
700 { | |
701 normal_level = 1; | |
702 expert_level = 1; | |
703 master_level = 1; | |
704 grandmaster_level = 1; | |
1699 | 705 } |
1298 | 706 } |
1720 | 707 if ( pActors[uActorID].uAIState != Dead |
708 && pActors[uActorID].uAIState != Dying | |
709 && !dword_507BF0_is_there_popup_onscreen && pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID) ) | |
710 { | |
711 if ( normal_level | expert_level | master_level | grandmaster_level ) | |
712 { | |
713 if ( pActors[uActorID].pMonsterInfo.uLevel >= pPlayers[uActiveCharacter]->uLevel - 5 ) | |
714 speech = SPEECH_IDENTIFY_MONSTER_STRONGER; | |
715 else | |
716 speech = SPEECH_IDENTIFY_MONSTER_WEAKER; | |
717 } | |
718 else | |
719 speech = SPEECH_IDENTIFY_MONSTER_106; | |
720 pPlayers[uActiveCharacter]->PlaySound(speech, 0); | |
721 } | |
1298 | 722 |
1720 | 723 if ( (signed int)SkillToMastery(pParty->pPlayers[uActiveCharacter - 1].GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID)) >= 3 ) |
724 for_effects = 1; | |
1705 | 725 |
726 if ( monster_full_informations == true ) | |
1298 | 727 { |
1705 | 728 normal_level = 1;// |
729 expert_level = 1;// | |
730 master_level = 1;// | |
731 grandmaster_level = 1;// | |
1720 | 732 for_effects = 1; |
1298 | 733 } |
734 | |
2216 | 735 pWindow->DrawText(pFontSmallnum, 12, 196, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[631], 0, 0, 0);//Effects |
2195 | 736 if ( !for_effects && false) |
2216 | 737 pWindow->DrawText(pFontSmallnum, 28, LOBYTE(pFontSmallnum->uFontHeight) + 193, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[630], 0, 0, 0);//? |
1298 | 738 else |
739 { | |
1705 | 740 pText = ""; |
741 pTextHeight = LOBYTE(pFontSmallnum->uFontHeight) + 193; | |
742 for ( uint i = 1; i <= 21; ++i ) | |
743 { | |
744 if ( pActors[uActorID].pActorBuffs[i].uExpireTime > 0 ) | |
745 { | |
2195 | 746 switch ( i ) |
1705 | 747 { |
2195 | 748 case ACTOR_BUFF_CHARM: |
1705 | 749 pTextColorID = 60; |
750 pText = pGlobalTXT_LocalizationStrings[591];//Charmed | |
751 break; | |
2195 | 752 case ACTOR_BUFF_SUMMONED: |
1705 | 753 pTextColorID = 82; |
754 pText = pGlobalTXT_LocalizationStrings[649];//Summoned | |
755 break; | |
2195 | 756 case ACTOR_BUFF_SHRINK: |
1705 | 757 pTextColorID = 92; |
758 pText = pGlobalTXT_LocalizationStrings[592];//Shrunk | |
759 break; | |
2195 | 760 case ACTOR_BUFF_AFRAID: |
1705 | 761 pTextColorID = 63; |
762 pText = pGlobalTXT_LocalizationStrings[4];//Afraid | |
763 break; | |
2195 | 764 case ACTOR_BUFF_STONED: |
1705 | 765 pText = pGlobalTXT_LocalizationStrings[220];//Stoned |
766 pTextColorID = 81; | |
767 break; | |
2195 | 768 case ACTOR_BUFF_PARALYZED: |
1705 | 769 pText = pGlobalTXT_LocalizationStrings[162];//Paralyzed |
770 pTextColorID = 81; | |
771 break; | |
2195 | 772 case ACTOR_BUFF_SLOWED: |
1705 | 773 pText = pGlobalTXT_LocalizationStrings[593];//Slowed |
774 pTextColorID = 35; | |
775 break; | |
2195 | 776 case ACTOR_BUFF_BERSERK: |
1705 | 777 pText = pGlobalTXT_LocalizationStrings[608];//Berserk |
778 pTextColorID = 62; | |
779 break; | |
2195 | 780 case ACTOR_BUFF_SOMETHING_THAT_HALVES_AC: |
781 case ACTOR_BUFF_MASS_DISTORTION: | |
1705 | 782 pText = ""; |
783 pTextColorID = 0; | |
784 continue; | |
2195 | 785 case ACTOR_BUFF_FATE: |
1705 | 786 pTextColorID = 47; |
787 pText = pGlobalTXT_LocalizationStrings[221];//Fate | |
788 break; | |
2195 | 789 case ACTOR_BUFF_ENSLAVED: |
1705 | 790 pTextColorID = 66; |
791 pText = pGlobalTXT_LocalizationStrings[607];//Enslaved | |
792 break; | |
2195 | 793 case ACTOR_BUFF_DAY_OF_PROTECTION: |
1705 | 794 pTextColorID = 85; |
795 pText = pGlobalTXT_LocalizationStrings[610];//Day of Protection | |
796 break; | |
2195 | 797 case ACTOR_BUFF_HOUR_OF_POWER: |
1705 | 798 pTextColorID = 86; |
799 pText = pGlobalTXT_LocalizationStrings[609];//Hour of Power | |
800 break; | |
2195 | 801 case ACTOR_BUFF_SHIELD: |
1705 | 802 pTextColorID = 17; |
803 pText = pGlobalTXT_LocalizationStrings[279];//Shield | |
804 break; | |
2195 | 805 case ACTOR_BUFF_STONESKIN: |
1705 | 806 pTextColorID = 38; |
807 pText = pGlobalTXT_LocalizationStrings[442];//Stoneskin | |
808 break; | |
2195 | 809 case ACTOR_BUFF_BLESS: |
1705 | 810 pTextColorID = 46; |
811 pText = pGlobalTXT_LocalizationStrings[443];//Bless | |
812 break; | |
2195 | 813 case ACTOR_BUFF_HEROISM: |
1705 | 814 pTextColorID = 51; |
815 pText = pGlobalTXT_LocalizationStrings[440];//Heroism | |
816 break; | |
2195 | 817 case ACTOR_BUFF_HASTE: |
1705 | 818 pTextColorID = 5; |
819 pText = pGlobalTXT_LocalizationStrings[441];//Haste | |
820 break; | |
2195 | 821 case ACTOR_BUFF_PAIN_REFLECTION: |
1705 | 822 pTextColorID = 95; |
823 pText = pGlobalTXT_LocalizationStrings[229];//Pain Reflection | |
824 break; | |
2195 | 825 case ACTOR_BUFF_PAIN_HAMMERHANDS: |
1705 | 826 pTextColorID = 73; |
827 pText = pGlobalTXT_LocalizationStrings[228];//Hammerhands | |
828 break; | |
829 default: | |
830 pText = ""; | |
831 break; | |
832 } | |
2195 | 833 if ( _stricmp(pText, "" )) |
1705 | 834 { |
2216 | 835 pWindow->DrawText(pFontSmallnum, 28, pTextHeight, GetSpellColor(pTextColorID), pText, 0, 0, 0); |
1705 | 836 pTextHeight = pTextHeight + *(char *)((int)pFontSmallnum + 5) - 3; |
837 } | |
838 } | |
839 } | |
2195 | 840 if ( !_stricmp(pText,"" )) |
2216 | 841 pWindow->DrawText(pFontSmallnum, 28, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[153], 0, 0, 0);//Íåò |
1705 | 842 } |
1298 | 843 |
1705 | 844 if ( normal_level ) |
1298 | 845 { |
1699 | 846 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, pActors[uActorID].pMonsterInfo.uHP); |
2216 | 847 pWindow->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 848 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
849 sprintf(pTmpBuf.data(), "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[12], 0, pActors[uActorID].pMonsterInfo.uAC);//Armor Class | |
1298 | 850 } |
851 else | |
852 { | |
2195 | 853 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]);//? - [630] actually displays a question mark |
2216 | 854 pWindow->DrawText(pFontSmallnum, 150, (int)v106.uViewportY, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 855 pTextHeight = v106.uViewportY + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
2195 | 856 sprintf(pTmpBuf.data(), "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[12], 0, pGlobalTXT_LocalizationStrings[630]);//? - [630] actually displays a question mark |
1298 | 857 } |
2216 | 858 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 859 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); |
860 | |
861 content[0] = pGlobalTXT_LocalizationStrings[87]; | |
862 content[1] = pGlobalTXT_LocalizationStrings[6]; | |
863 content[2] = pGlobalTXT_LocalizationStrings[240]; | |
864 content[3] = pGlobalTXT_LocalizationStrings[70]; | |
865 content[4] = pGlobalTXT_LocalizationStrings[624]; | |
866 content[5] = pGlobalTXT_LocalizationStrings[138]; | |
867 content[6] = pGlobalTXT_LocalizationStrings[214]; | |
868 content[7] = pGlobalTXT_LocalizationStrings[142]; | |
869 content[8] = pGlobalTXT_LocalizationStrings[29]; | |
870 content[9] = pGlobalTXT_LocalizationStrings[133]; | |
871 content[10] = pGlobalTXT_LocalizationStrings[54]; | |
872 | |
873 if ( expert_level ) | |
1298 | 874 { |
1705 | 875 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, content[pActors[uActorID].pMonsterInfo.uAttack1Type]);//Attack |
2216 | 876 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 877 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
878 if ( pActors[uActorID].pMonsterInfo.uAttack1DamageBonus ) | |
1298 | 879 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], |
1705 | 880 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides, pActors[uActorID].pMonsterInfo.uAttack1DamageBonus); |
1298 | 881 else |
882 sprintf(pTmpBuf.data(), "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], | |
1699 | 883 0, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls, pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides); |
1298 | 884 } |
885 else | |
886 { | |
887 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); | |
2216 | 888 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 889 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
1298 | 890 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); |
891 } | |
2216 | 892 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 893 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 6 + LOBYTE(pFontSmallnum->uFontHeight); |
894 | |
895 if ( !master_level ) | |
1298 | 896 { |
1705 | 897 sprintf(pTmpBuf.data(), "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[630]);//"Spell" "?" |
2216 | 898 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 899 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
1298 | 900 } |
901 else | |
902 { | |
1705 | 903 pText = pGlobalTXT_LocalizationStrings[628];//Spell |
904 if ( pActors[uActorID].pMonsterInfo.uSpell1ID && pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
905 pText = pGlobalTXT_LocalizationStrings[629];//Spells | |
906 if ( pActors[uActorID].pMonsterInfo.uSpell1ID ) | |
907 { | |
1718 | 908 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pText, 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell1ID].pShortName);//"%s\f%05u\t060%s\n" |
2216 | 909 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 910 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
911 } | |
912 if ( pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
913 { | |
1718 | 914 sprintf(pTmpBuf.data(), "\f%05u\t070%s\n", 0, pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell2ID].pShortName);//"%s\f%05u\t060%s\n" |
2216 | 915 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 916 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
917 } | |
918 if ( !pActors[uActorID].pMonsterInfo.uSpell1ID && !pActors[uActorID].pMonsterInfo.uSpell2ID ) | |
919 { | |
1718 | 920 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", pGlobalTXT_LocalizationStrings[628], 0, pGlobalTXT_LocalizationStrings[153]);//"%s\f%05u\t060%s\n" |
2216 | 921 pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 922 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
923 } | |
1298 | 924 } |
1705 | 925 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
2216 | 926 pWindow->DrawText(pFontSmallnum, 150, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pGlobalTXT_LocalizationStrings[626], 0, 0, 0);//Immune |
1705 | 927 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
928 | |
929 string_name[0] = pGlobalTXT_LocalizationStrings[87];//Fire | |
930 string_name[1] = pGlobalTXT_LocalizationStrings[6];//Air | |
931 string_name[2] = pGlobalTXT_LocalizationStrings[240]; | |
932 string_name[3] = pGlobalTXT_LocalizationStrings[70]; | |
933 string_name[4] = pGlobalTXT_LocalizationStrings[142]; | |
934 string_name[5] = pGlobalTXT_LocalizationStrings[214]; | |
935 string_name[6] = pGlobalTXT_LocalizationStrings[29]; | |
936 string_name[7] = pGlobalTXT_LocalizationStrings[133]; | |
937 string_name[8] = pGlobalTXT_LocalizationStrings[54]; | |
938 string_name[9] = pGlobalTXT_LocalizationStrings[624]; | |
939 | |
2195 | 940 resistances[0] = pActors[uActorID].pMonsterInfo.uResFire; |
941 resistances[1] = pActors[uActorID].pMonsterInfo.uResAir; | |
942 resistances[2] = pActors[uActorID].pMonsterInfo.uResWater; | |
943 resistances[3] = pActors[uActorID].pMonsterInfo.uResEarth; | |
944 resistances[4] = pActors[uActorID].pMonsterInfo.uResMind; | |
945 resistances[5] = pActors[uActorID].pMonsterInfo.uResSpirit; | |
946 resistances[6] = pActors[uActorID].pMonsterInfo.uResBody; | |
947 resistances[7] = pActors[uActorID].pMonsterInfo.uResLight; | |
948 resistances[8] = pActors[uActorID].pMonsterInfo.uResPhysical; | |
949 resistances[9] = pActors[uActorID].pMonsterInfo.uResDark; | |
1705 | 950 |
951 if ( grandmaster_level ) | |
1298 | 952 { |
1705 | 953 for ( uint i = 0; i < 10; i++ ) |
1298 | 954 { |
2195 | 955 if ( resistances[i] == 200 ) |
1298 | 956 { |
1705 | 957 pText = pGlobalTXT_LocalizationStrings[625];//Immune |
1298 | 958 } |
959 else | |
960 { | |
2195 | 961 if ( resistances[i] ) |
1705 | 962 pText = pGlobalTXT_LocalizationStrings[627];//Resistant |
1298 | 963 else |
1705 | 964 pText = pGlobalTXT_LocalizationStrings[153];//None |
1298 | 965 } |
1705 | 966 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pText); |
2216 | 967 pWindow->DrawText(pFontSmallnum, 170, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 968 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
1298 | 969 } |
970 } | |
971 else | |
972 { | |
1705 | 973 for ( uint i = 0; i < 10; ++i ) |
1298 | 974 { |
1705 | 975 sprintf(pTmpBuf.data(), "%s\f%05u\t070%s\n", string_name[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" |
2216 | 976 pWindow->DrawText(pFontSmallnum, 170, pTextHeight, Color16(0xE1u, 255, 0x9Bu), pTmpBuf.data(), 0, 0, 0); |
1705 | 977 pTextHeight = pTextHeight + LOBYTE(pFontSmallnum->uFontHeight) - 3; |
1298 | 978 } |
979 } | |
1720 | 980 //cast spell: Detect life |
1298 | 981 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].uExpireTime > 0 ) |
982 { | |
1705 | 983 sprintf(pTmpBuf.data(), "%s: %d", pGlobalTXT_LocalizationStrings[650], pActors[uActorID].sCurrentHP);//Current Hit Points |
1298 | 984 pFontSmallnum->GetLineWidth(pTmpBuf.data()); |
2216 | 985 pWindow->DrawTitleText(pFontSmallnum, 0, pWindow->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf.data(), 3); |
1298 | 986 } |
987 } | |
988 | |
989 //----- (00417BB5) -------------------------------------------------------- | |
990 const char *CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType) | |
991 { | |
1720 | 992 char a2[1200]; // [sp+Ch] [bp-538h]@7 |
993 char Source[120]; // [sp+4BCh] [bp-88h]@7 | |
994 int v35; // [sp+53Ch] [bp-8h]@1 | |
995 | |
996 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal | |
997 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]) > (signed int)v35 ) | |
998 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert | |
999 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]) > (signed int)v35 ) | |
1000 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master | |
1001 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]) > (signed int)v35 ) | |
1002 v35 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand | |
1298 | 1003 |
1720 | 1004 a2[0] = 0; |
1005 Source[0] = 0; | |
1006 strcpy(a2, "%s\n\n"); | |
1007 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 1)); | |
1008 strcat(a2, Source); | |
1009 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1010 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 2)); | |
1011 strcat(a2, Source); | |
1012 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1013 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 3)); | |
1014 strcat(a2, Source); | |
1015 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1016 sprintf(Source, "\f%05d", GetSkillColor(pParty->pPlayers[uPlayerID].classType, uPlayerSkillType, 4)); | |
1017 strcat(a2, Source); | |
1018 strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); | |
1019 if ( (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F) == (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) ) | |
1020 { | |
1021 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType], | |
1022 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], // Normal | |
1023 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], // Expert | |
1024 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], // Master | |
1025 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType]); // Grand | |
1026 } | |
1027 else | |
1028 { | |
2069 | 1029 sprintf(Source, "\f%05d", Color16(0xFFu, 0xFFu, 0xFFu)); |
1720 | 1030 strcat(a2, Source); |
1031 strcat(a2, "%s: +%d"); | |
1032 sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[uPlayerSkillType], | |
1033 pGlobalTXT_LocalizationStrings[431], v35 + 3, v35 + 5, pNormalSkillDesc[uPlayerSkillType], | |
1034 pGlobalTXT_LocalizationStrings[433], v35 + 3, v35 + 5, pExpertSkillDesc[uPlayerSkillType], | |
1035 pGlobalTXT_LocalizationStrings[432], v35 + 3, v35 + 5, pMasterSkillDesc[uPlayerSkillType], | |
1036 pGlobalTXT_LocalizationStrings[96], v35 + 3, v35 + 5, pGrandSkillDesc[uPlayerSkillType], | |
1037 pGlobalTXT_LocalizationStrings[623], //Bonus | |
1038 (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) & 0x3F) - (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F)); | |
1039 } | |
1040 return static_sub_417BB5_out_string; | |
1041 } | |
1298 | 1042 |
1043 //----- (00417FE5) -------------------------------------------------------- | |
1720 | 1044 void CharacterUI_SkillsTab_ShowHint() |
1045 { | |
1046 GUIButton *pButton; // esi@6 | |
1047 unsigned int pX; // [sp+4h] [bp-8h]@1 | |
1048 unsigned int pY; // [sp+8h] [bp-4h]@1 | |
1298 | 1049 |
1720 | 1050 pMouse->GetClickPos(&pX, &pY); |
1051 if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) | |
1052 { | |
1053 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) | |
1054 { | |
1055 if ( pButton->msg == UIMSG_SkillUp | |
1056 && (signed int)pX >= (signed int)pButton->uX | |
1057 && (signed int)pX <= (signed int)pButton->uZ | |
1058 && (signed int)pY >= (signed int)pButton->uY | |
1059 && (signed int)pY <= (signed int)pButton->uW ) | |
1060 { | |
1061 CharacterUI_DrawTooltip(pSkillNames[pButton->msg_param], CharacterUI_GetSkillDescText(uActiveCharacter - 1, (PLAYER_SKILL_TYPE)pButton->msg_param)); | |
1062 } | |
1298 | 1063 } |
1720 | 1064 } |
1065 else | |
1066 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription);//Î÷êè íàâûêîâ | |
1067 } | |
1298 | 1068 |
1069 //----- (00418083) -------------------------------------------------------- | |
1458 | 1070 void CharacterUI_StatsTab_ShowHint() |
1393 | 1071 { |
1298 | 1072 int pStringNum; // edi@1 |
1073 signed int pTextColor; // eax@15 | |
1838 | 1074 const char *pHourWord; // ecx@17 |
1075 const char *pDayWord; // eax@20 | |
1298 | 1076 int v15; // ebx@28 |
1077 POINT a2; // [sp+Ch] [bp-24h]@1 | |
1078 int pHour; // [sp+14h] [bp-1Ch]@15 | |
1079 unsigned int pDay; // [sp+24h] [bp-Ch]@15 | |
1080 | |
1393 | 1081 pMouse->GetCursorPos(&a2); |
1082 for ( pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum ) | |
1298 | 1083 { |
1393 | 1084 if (a2.x >= stat_string_coord[pStringNum].x && a2.x <= stat_string_coord[pStringNum].x + stat_string_coord[pStringNum].width ) |
1298 | 1085 { |
1393 | 1086 if (a2.y >= stat_string_coord[pStringNum].y && a2.y <= stat_string_coord[pStringNum].y + stat_string_coord[pStringNum].height ) |
1298 | 1087 break; |
1088 } | |
1089 } | |
1393 | 1090 |
1298 | 1091 switch ( pStringNum ) |
1092 { | |
1093 case 0:// Attributes | |
1094 case 1: | |
1095 case 2: | |
1096 case 3: | |
1097 case 4: | |
1098 case 5: | |
1099 case 6: | |
1100 if ( aAttributeNames[pStringNum] && pAttributeDescriptions[pStringNum] ) | |
1393 | 1101 CharacterUI_DrawTooltip(aAttributeNames[pStringNum], pAttributeDescriptions[pStringNum]); |
1298 | 1102 break; |
1103 case 7:// Health Points | |
1104 if ( pGlobalTXT_LocalizationStrings[108] && pHealthPointsAttributeDescription ) | |
1393 | 1105 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[108], pHealthPointsAttributeDescription); |
1298 | 1106 break; |
1107 case 8:// Spell Points | |
1108 if ( pGlobalTXT_LocalizationStrings[212] && pSpellPointsAttributeDescription ) | |
1393 | 1109 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[212], pSpellPointsAttributeDescription); |
1298 | 1110 break; |
1111 case 9:// Armor Class | |
1112 if ( pGlobalTXT_LocalizationStrings[12] && pArmourClassAttributeDescription ) | |
1393 | 1113 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[12], pArmourClassAttributeDescription); |
1298 | 1114 break; |
1115 case 10:// Player Condition | |
1116 strcpy(pTmpBuf2.data(), pPlayerConditionAttributeDescription); | |
1117 strcat(pTmpBuf2.data(), "\n"); | |
1118 extern std::array<unsigned int, 18> pConditionImportancyTable; | |
1119 for ( uint i = 0; i < 18; ++i ) | |
1120 { | |
1121 if ( pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]] ) | |
1122 { | |
1123 strcat(pTmpBuf2.data(), " \n"); | |
1124 pHour = pParty->uTimePlayed - pPlayers[uActiveCharacter]->pConditions[pConditionImportancyTable[i]]; | |
1125 pHour = (unsigned int)((pHour * 0.234375) / 60 / 60); | |
1126 pDay = (unsigned int)pHour / 24; | |
1127 pHour %= 24i64; | |
1128 pTextColor = GetConditionDrawColor(pConditionImportancyTable[i]); | |
1129 sprintfex(pTmpBuf.data(), format_4E2DE8, pTextColor, aCharacterConditionNames[pConditionImportancyTable[i]]); | |
1130 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1131 if ( pHour && pHour <= 1 ) | |
1132 pHourWord = pGlobalTXT_LocalizationStrings[109]; | |
1133 else | |
1134 pHourWord = pGlobalTXT_LocalizationStrings[110]; | |
1135 if ( !pDay || (pDayWord = pGlobalTXT_LocalizationStrings[56], pDay > 1) ) | |
1136 pDayWord = pGlobalTXT_LocalizationStrings[57]; | |
1137 sprintfex(pTmpBuf.data(), "%lu %s, %lu %s", pDay, pDayWord, pHour, pHourWord); | |
1138 strcat(pTmpBuf2.data(), pTmpBuf.data()); | |
1139 } | |
1140 } | |
1141 if ( pGlobalTXT_LocalizationStrings[47] && pTmpBuf2.data() ) | |
1393 | 1142 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[47], pTmpBuf2.data()); |
1298 | 1143 break; |
1144 case 11:// Fast Spell | |
1145 if ( pGlobalTXT_LocalizationStrings[172] && pFastSpellAttributeDescription ) | |
1393 | 1146 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[172], pFastSpellAttributeDescription); |
1298 | 1147 break; |
1148 case 12:// Player Age | |
1149 if ( pGlobalTXT_LocalizationStrings[5] && pPlayerAgeAttributeDescription ) | |
1393 | 1150 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[5], pPlayerAgeAttributeDescription); |
1298 | 1151 break; |
1152 case 13:// Player Level | |
1153 if ( pGlobalTXT_LocalizationStrings[131] && pPlayerLevelAttributeDescription ) | |
1393 | 1154 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[131], pPlayerLevelAttributeDescription); |
1298 | 1155 break; |
1156 case 14://Experience | |
1157 v15 = pPlayers[uActiveCharacter]->uLevel; | |
1158 do | |
1159 { | |
1459 | 1160 if ( (signed __int64)pPlayers[uActiveCharacter]->uExperience < (unsigned int)GetExperienceRequiredForLevel(v15) ) |
1298 | 1161 break; |
1162 ++v15; | |
1163 } | |
1164 while ( v15 <= 10000 ); | |
1165 pTmpBuf[0] = 0; | |
1166 pTmpBuf2[0] = 0; | |
1167 if ( v15 > pPlayers[uActiveCharacter]->uLevel ) | |
1168 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[147], v15); | |
1720 | 1169 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], GetExperienceRequiredForLevel(v15) - LODWORD(pPlayers[uActiveCharacter]->uExperience), v15 + 1); |
1298 | 1170 strcat(pTmpBuf.data(), "\n"); |
1171 strcat(pTmpBuf.data(), pTmpBuf2.data()); | |
1172 sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data()); | |
1173 if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() ) | |
1393 | 1174 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data()); |
1298 | 1175 break; |
1176 case 15:// Attack Bonus | |
1177 if ( pGlobalTXT_LocalizationStrings[587] && pAttackBonusAttributeDescription ) | |
1393 | 1178 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[587], pAttackBonusAttributeDescription); |
1298 | 1179 break; |
1180 case 16:// Attack Damage | |
1181 if ( pGlobalTXT_LocalizationStrings[588] && pAttackDamageAttributeDescription ) | |
1393 | 1182 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[588], pAttackDamageAttributeDescription); |
1298 | 1183 break; |
1184 case 17:// Missle Bonus | |
1185 if ( pGlobalTXT_LocalizationStrings[589] && pMissleBonusAttributeDescription ) | |
1393 | 1186 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[589], pMissleBonusAttributeDescription); |
1298 | 1187 break; |
1188 case 18:// Missle Damage | |
1189 if ( pGlobalTXT_LocalizationStrings[590] && pMissleDamageAttributeDescription ) | |
1393 | 1190 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[590], pMissleDamageAttributeDescription); |
1298 | 1191 break; |
1192 case 19:// Fire Resistance | |
1193 if ( pGlobalTXT_LocalizationStrings[87] && pFireResistanceAttributeDescription ) | |
1393 | 1194 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[87], pFireResistanceAttributeDescription); |
1298 | 1195 break; |
1196 case 20:// Air Resistance | |
1197 if ( pGlobalTXT_LocalizationStrings[6] && pAirResistanceAttributeDescription ) | |
1393 | 1198 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[6], pAirResistanceAttributeDescription); |
1298 | 1199 break; |
1200 case 21:// Water Resistance | |
1201 if ( pGlobalTXT_LocalizationStrings[240] && pWaterResistanceAttributeDescription ) | |
1393 | 1202 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[240], pWaterResistanceAttributeDescription); |
1298 | 1203 break; |
1204 case 22:// Earth Resistance | |
1205 if ( pGlobalTXT_LocalizationStrings[70] && pEarthResistanceAttributeDescription ) | |
1393 | 1206 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[70], pEarthResistanceAttributeDescription); |
1298 | 1207 break; |
1208 case 23:// Mind Resistance | |
1209 if ( pGlobalTXT_LocalizationStrings[142] && pMindResistanceAttributeDescription ) | |
1393 | 1210 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[142], pMindResistanceAttributeDescription); |
1298 | 1211 break; |
1212 case 24:// Body Resistance | |
1213 if ( pGlobalTXT_LocalizationStrings[29] && pBodyResistanceAttributeDescription ) | |
1393 | 1214 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[29], pBodyResistanceAttributeDescription); |
1298 | 1215 break; |
1216 case 25: // Skill Points | |
1217 if ( pGlobalTXT_LocalizationStrings[207] && pSkillPointsAttributeDescription ) | |
1393 | 1218 CharacterUI_DrawTooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); |
1298 | 1219 break; |
1393 | 1220 case 26: // Class description |
1221 { | |
1678 | 1222 if (pClassDescriptions[pPlayers[uActiveCharacter]->classType] && pClassNames[pPlayers[uActiveCharacter]->classType]) |
1223 CharacterUI_DrawTooltip(pClassNames[pPlayers[uActiveCharacter]->classType], pClassDescriptions[pPlayers[uActiveCharacter]->classType]); | |
1393 | 1224 } |
1225 break; | |
1226 | |
1298 | 1227 default: |
1228 break; | |
1229 } | |
1230 } | |
1231 | |
1720 | 1232 //----- (00410B28) -------------------------------------------------------- |
1233 void DrawSpellDescriptionPopup(int spell_index) | |
1234 { | |
1235 SpellInfo *spell; // esi@1 | |
1236 unsigned int v3; // eax@2 | |
1237 LONG v5; // ecx@4 | |
1238 GUIWindow spell_info_window; // [sp+Ch] [bp-68h]@4 | |
1239 POINT mouse; // [sp+64h] [bp-10h]@1 | |
1298 | 1240 |
1720 | 1241 spell = &pSpellStats->pInfos[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1]; |
1242 if ( pMouse->GetCursorPos(&mouse)->y <= 250 ) | |
1243 v3 = pMouse->GetCursorPos(&mouse)->y + 30; | |
1244 else | |
1245 v3 = 30; | |
1246 spell_info_window.uFrameY = v3; | |
1247 spell_info_window.uFrameWidth = 328; | |
1248 spell_info_window.uFrameHeight = 68; | |
1249 spell_info_window.uFrameX = 90; | |
1250 spell_info_window.uFrameZ = 417; | |
1251 spell_info_window.uFrameW = v3 + 67; | |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
1252 spell_info_window.Hint = nullptr; |
1720 | 1253 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]); |
1254 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]) > v5 ) | |
1255 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]); | |
1256 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]) > v5 ) | |
1257 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]); | |
1258 if ( pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]) > v5 ) | |
1259 v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]); | |
1260 sprintf(pTmpBuf2.data(), | |
1298 | 1261 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s", |
1720 | 1262 spell->pDescription, |
1263 pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], v5 + 3, v5 + 10, spell->pBasicSkillDesc, | |
1264 pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], v5 + 3, v5 + 10, spell->pExpertSkillDesc, | |
1265 pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], v5 + 3, v5 + 10, spell->pMasterSkillDesc, | |
1266 pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], v5 + 3, v5 + 10, spell->pGrandmasterSkillDesc); | |
1267 spell_info_window.uFrameHeight += pFontSmallnum->CalcTextHeight(pTmpBuf2.data(), &spell_info_window, 0, 0); | |
1268 if ( (signed int)spell_info_window.uFrameHeight < 150 ) | |
1269 spell_info_window.uFrameHeight = 150; | |
1270 spell_info_window.uFrameWidth = game_viewport_width; | |
1271 spell_info_window.DrawMessageBox(0); | |
1272 spell_info_window.uFrameWidth -= 12; | |
1273 spell_info_window.uFrameHeight -= 12; | |
1274 spell_info_window.uFrameZ = spell_info_window.uFrameX + spell_info_window.uFrameWidth - 1; | |
1275 spell_info_window.uFrameW = spell_info_window.uFrameHeight + spell_info_window.uFrameY - 1; | |
2069 | 1276 spell_info_window.DrawTitleText(pFontArrus, 0x78u, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), spell->pName, 3); |
1720 | 1277 spell_info_window.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2.data(), 0, 0, 0); |
1278 spell_info_window.uFrameWidth = 108; | |
1279 spell_info_window.uFrameZ = spell_info_window.uFrameX + 107; | |
2192 | 1280 int skill_level = SkillToMastery(pPlayers[uActiveCharacter]->pActiveSkills[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12]); |
1281 spell_info_window.DrawTitleText(pFontComic, 12, 75, 0, pSkillNames[pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12], 3); | |
1720 | 1282 sprintf( pTmpBuf.data(), "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST], |
2192 | 1283 pSpellDatas[spell_index + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 1].mana_per_skill[skill_level - 1]); |
1284 spell_info_window.DrawTitleText(pFontComic, 12, spell_info_window.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf.data(), 3); | |
1720 | 1285 dword_507B00_spell_info_to_draw_in_popup = 0; |
1286 } | |
1298 | 1287 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; |
1288 | |
1289 //----- (00416D62) -------------------------------------------------------- | |
1802 | 1290 void UI_OnMouseRightClick(Vec2_int_ *_this) |
1298 | 1291 { |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1292 int v5; // esi@62 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1293 GUIButton *pButton; // esi@84 |
1838 | 1294 const char *pStr; // edi@85 |
1843
2e6d3cd052e0
some char* cast removal + adding const_casts where appropriate
Grumpy7
parents:
1842
diff
changeset
|
1295 const char *pHint; // edx@113 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1296 GUIWindow popup_window; // [sp+4h] [bp-74h]@32 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1297 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1298 unsigned int pX; // [sp+70h] [bp-8h]@3 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1299 unsigned int pY; // [sp+74h] [bp-4h]@3 |
1298 | 1300 |
2098 | 1301 if ( pCurrentScreen == SCREEN_VIDEO || GetCurrentMenuID() == MENU_MAIN ) |
1720 | 1302 return; |
1303 if ( _this ) | |
1304 { | |
1305 pX = _this->x; | |
1306 pY = _this->y; | |
1307 } | |
1308 else | |
1309 { | |
1310 pMouse->GetClickPos(&pX, &pY); | |
1311 } | |
2155 | 1312 //if ( pRenderer->bWindowMode ) |
1720 | 1313 { |
1314 GetCursorPos(&Point); | |
1802 | 1315 ScreenToClient(window->GetApiHandle(), &Point); |
1720 | 1316 if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) |
1317 { | |
1318 back_to_game(); | |
1319 return; | |
1320 } | |
1321 } | |
1322 if ( pParty->pPickedItem.uItemID )//íàæàòèå íà ïîðòðåò ïåðñà ïðàâîé êíîïêîé ìûøè ñ ðàñòâîðîì | |
1323 { | |
1324 for ( uint i = 0; i < 4; ++i ) | |
1325 { | |
1326 if ( (signed int)pX > RightClickPortraitXmin[i] && (signed int)pX < RightClickPortraitXmax[i] | |
1327 && (signed int)pY > 375 && (signed int)pY < 466 ) | |
1328 { | |
1329 pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(i + 1, 1); | |
1330 return; | |
1331 } | |
1332 } | |
1333 } | |
1298 | 1334 |
1720 | 1335 pEventTimer->Pause(); |
1336 switch(pCurrentScreen) | |
1337 { | |
1338 case SCREEN_CASTING: | |
1339 { | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1340 Inventory_ItemPopupAndAlchemy(); |
1720 | 1341 break; |
1342 } | |
1343 case SCREEN_CHEST: | |
1344 { | |
1345 if ( !pPlayers[uActiveCharacter]->CanAct() ) | |
1346 { | |
1347 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s íå â ñîñòîÿíèè %s Îïîçíàòü ïðåäìåòû | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1348 popup_window.Hint = pTmpBuf.data(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1349 popup_window.uFrameWidth = 384; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1350 popup_window.uFrameHeight = 180; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1351 popup_window.uFrameY = 40; |
1720 | 1352 if ( (signed int)pX <= 320 ) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1353 popup_window.uFrameX = pX + 30; |
1720 | 1354 else |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1355 popup_window.uFrameX = pX - 414; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1356 popup_window.DrawMessageBox(0); |
1720 | 1357 } |
1358 else | |
1359 { | |
1360 if ( pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF ) | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1361 GameUI_DrawItemInfo(&pChests[pChestWindow->par1C].igChestItems[pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] & 0xFFFF) - 1] - 1]); |
1720 | 1362 } |
1363 break; | |
1364 } | |
1730 | 1365 case SCREEN_GAME://In the main menu displays a pop-up window(Â ãëàâíîì ìåíþ ïîêàçûâàåò âñïëûâàþùåå îêíî) |
1720 | 1366 { |
1367 if (GetCurrentMenuID() > 0) | |
1368 break; | |
1369 if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) | |
1370 { | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1371 popup_window.ptr_1C = (void *)((signed int)pX / 118); |
1720 | 1372 if ( (signed int)pX / 118 < 4 )//portaits zone |
1373 { | |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
1374 popup_window.Hint = nullptr; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1375 popup_window.uFrameWidth = 400; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1376 popup_window.uFrameHeight = 200; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1377 popup_window.uFrameX = 38; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1378 popup_window.uFrameY = 60; |
1720 | 1379 pAudioPlayer->StopChannels(-1, -1); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1380 GameUI_CharacterQuickRecord_Draw(&popup_window, pPlayers[(int)popup_window.ptr_1C + 1]); |
1720 | 1381 } |
1382 } | |
1383 else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) | |
1384 { | |
1385 if ( (signed int)pY >= 130 ) | |
1386 { | |
1387 if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 )//buff_tooltip zone | |
1388 { | |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
1389 popup_window.Hint = nullptr; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1390 popup_window.uFrameWidth = 400; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1391 popup_window.uFrameHeight = 200; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1392 popup_window.uFrameX = 38; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1393 popup_window.uFrameY = 60; |
1720 | 1394 pAudioPlayer->StopChannels(-1, -1); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1395 popup_window._41D73D_draw_buff_tooltip(); |
1720 | 1396 } |
1397 else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 )//NPC zone | |
1398 { | |
1399 if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) | |
1400 { | |
1401 pAudioPlayer->StopChannels(-1, -1); | |
1402 GameUI_DrawNPCPopup((void *)1);//NPC 2 | |
1298 | 1403 } |
1720 | 1404 } |
1405 else | |
1406 { | |
1298 | 1407 pAudioPlayer->StopChannels(-1, -1); |
1720 | 1408 GameUI_DrawNPCPopup(0);//NPC 1 |
1409 } | |
1410 } | |
1411 else//minimap zone | |
1412 { | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1413 popup_window.Hint = (char *)GameUI_GetMinimapHintText(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1414 popup_window.uFrameWidth = 256; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1415 popup_window.uFrameX = 130; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1416 popup_window.uFrameY = 140; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1417 popup_window.uFrameHeight = 64; |
1720 | 1418 pAudioPlayer->StopChannels(-1, -1); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1419 popup_window.DrawMessageBox(0); |
1720 | 1420 } |
1421 } | |
1422 else//game zone | |
1423 { | |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
1424 popup_window.Hint = nullptr; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1425 popup_window.uFrameWidth = 320; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1426 popup_window.uFrameHeight = 320; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1427 popup_window.uFrameX = pX - 350; |
1720 | 1428 if ( (signed int)pX <= 320 ) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1429 popup_window.uFrameX = pX + 30; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1430 popup_window.uFrameY = 40; |
2155 | 1431 //if ( pRenderer->pRenderD3D ) |
1432 v5 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1433 /*else | |
1434 v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/ | |
1720 | 1435 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Actor) |
1436 { | |
2154 | 1437 /*if ( pRenderer->uNumSceneBegins ) |
1720 | 1438 { |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1439 popup_window.DrawMessageBox(1); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1440 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window); |
1720 | 1441 } |
2154 | 1442 else*/ |
1720 | 1443 { |
1444 pRenderer->BeginScene(); | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1445 popup_window.DrawMessageBox(1); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1446 MonsterPopup_Draw(PID_ID((unsigned __int16)v5), &popup_window); |
1720 | 1447 pRenderer->EndScene(); |
1448 } | |
1449 } | |
1450 if (PID_TYPE((unsigned __int16)v5) == OBJECT_Item) | |
1451 { | |
1452 if ( !(pObjectList->pObjects[pSpriteObjects[PID_ID((unsigned __int16)v5)].uObjectDescID].uFlags & 0x10 ) ) | |
1453 { | |
1454 GameUI_DrawItemInfo(&pSpriteObjects[PID_ID((unsigned __int16)v5)].stru_24); | |
1455 } | |
1456 } | |
1457 } | |
1458 break; | |
1459 } | |
1460 case SCREEN_BOOKS: | |
1461 { | |
1462 if ( !dword_506364 | |
1463 || (signed int)pX < (signed int)pViewport->uViewportTL_X || (signed int)pX > (signed int)pViewport->uViewportBR_X | |
1464 || (signed int)pY < (signed int)pViewport->uViewportTL_Y || (signed int)pY > (signed int)pViewport->uViewportBR_Y | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1465 || ((popup_window.Hint = (char *)GetMapBookHintText()) == 0) ) |
1720 | 1466 break; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1467 popup_window.uFrameWidth = (pFontArrus->GetLineWidth(popup_window.Hint) + 32) + 0.5f; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1468 popup_window.uFrameX = pX + 5; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1469 popup_window.uFrameY = pY + 5; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1470 popup_window.uFrameHeight = 64; |
1720 | 1471 pAudioPlayer->StopChannels(-1, -1); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1472 popup_window.DrawMessageBox(0); |
1720 | 1473 break; |
1474 } | |
1475 case SCREEN_CHARACTERS: | |
1723 | 1476 case SCREEN_E: |
1477 case SCREEN_CHEST_INVENTORY: | |
1478 { | |
1479 if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1480 Inventory_ItemPopupAndAlchemy(); |
1723 | 1481 else if ( (signed int)pY >= 345 ) |
1482 break; | |
1483 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats | |
1484 CharacterUI_StatsTab_ShowHint(); | |
1485 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills | |
1486 CharacterUI_SkillsTab_ShowHint(); | |
1725 | 1487 else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 )//2DEvent - CharacerScreenInventory |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1488 Inventory_ItemPopupAndAlchemy(); |
1723 | 1489 break; |
1490 } | |
1491 case SCREEN_SPELL_BOOK: | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1492 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1493 if ( dword_507B00_spell_info_to_draw_in_popup ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1494 DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1495 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1496 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1497 case SCREEN_HOUSE: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1498 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1499 if ( (signed int)pY < 345 && (signed int)pX < 469 ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1500 ShowPopupShopItem(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1501 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1502 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1503 case SCREEN_PARTY_CREATION: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1504 { |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
1505 popup_window.Hint = nullptr; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1506 pStr = 0; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1507 for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1508 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1509 if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1510 && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) |
1298 | 1511 { |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1512 switch ( pButton->msg ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1513 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1514 case UIMSG_0: //stats info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1515 popup_window.Hint = pAttributeDescriptions[(signed int)pButton->msg_param % 7]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1516 pStr = aAttributeNames[(signed int)pButton->msg_param % 7]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1517 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1518 case UIMSG_PlayerCreationClickPlus: //Plus button info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1519 pStr = pGlobalTXT_LocalizationStrings[670];//Äîáàâèòü |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1520 popup_window.Hint = pGlobalTXT_LocalizationStrings[671];//"Äîáàâëÿåò î÷êî ê âûäåëåííîìó íàâûêó, çàáèðàÿ åãî èç íàêîïèòåëÿ î÷êîâ" |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1521 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1522 case UIMSG_PlayerCreationClickMinus: //Minus button info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1523 pStr = pGlobalTXT_LocalizationStrings[668];//Âû÷åñòü |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1524 popup_window.Hint = pGlobalTXT_LocalizationStrings[669];//"Âû÷èòàåò î÷êî èç âûäåëåííîãî íàâûêà, âîçâðàùàÿ åãî â íàêîïèòåëü î÷êîâ" |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1525 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1526 case UIMSG_PlayerCreationSelectActiveSkill: //Available skill button info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1527 pStr = pSkillNames[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1528 popup_window.Hint = pSkillDesc[pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->msg_param + 4)]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1529 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1530 case UIMSG_PlayerCreationSelectClass: //Available Class Info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1531 popup_window.Hint = pClassDescriptions[pButton->msg_param]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1532 pStr = pClassNames[pButton->msg_param]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1533 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1534 case UIMSG_PlayerCreationClickOK: //OK Info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1535 popup_window.Hint = pGlobalTXT_LocalizationStrings[664];//Ùåëêíèòå çäåñü äëÿ óòâåðæäåíèÿ ñîñòàâà îòðÿäà è ïðîäîëæåíèÿ èãðû. |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1536 pStr = pGlobalTXT_LocalizationStrings[665];//Êíîïêà ÎÊ |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1537 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1538 case UIMSG_PlayerCreationClickReset: //Clear info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1539 popup_window.Hint = pGlobalTXT_LocalizationStrings[666];//Ñáðàñûâàåò âñå ïàðàìåòðû è íàâûêè îòðÿäà. |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1540 pStr = pGlobalTXT_LocalizationStrings[667];//Êíîïêà Î÷èñòèòü |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1541 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1542 case UIMSG_PlayerCreation_SelectAttribute: // Character info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1543 pStr = pParty->pPlayers[pButton->msg_param].pName; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1544 popup_window.Hint = pClassDescriptions[pParty->pPlayers[pButton->msg_param].classType]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1545 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1546 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1547 if ( pButton->msg > UIMSG_44 && pButton->msg <= UIMSG_PlayerCreationRemoveDownSkill ) //Sellected skills info |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1548 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1549 pY = 0; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1550 if ( (signed int)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48) < 37 ) |
1298 | 1551 { |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1552 strcpy(pTmpBuf2.data(), CharacterUI_GetSkillDescText(pButton->msg_param, (PLAYER_SKILL_TYPE)pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48))); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1553 popup_window.Hint = pTmpBuf2.data(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1554 pStr = pSkillNames[pParty->pPlayers[pButton->msg_param].GetSkillIdxByOrder(pButton->msg - UIMSG_48)]; |
1298 | 1555 } |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1556 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1557 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1558 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1559 if ( popup_window.Hint ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1560 { |
1843
2e6d3cd052e0
some char* cast removal + adding const_casts where appropriate
Grumpy7
parents:
1842
diff
changeset
|
1561 pHint = popup_window.Hint; |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
1562 popup_window.Hint = nullptr; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1563 popup_window.uFrameWidth = 384; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1564 popup_window.uFrameHeight = 256; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1565 popup_window.uFrameX = 128; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1566 popup_window.uFrameY = 40; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1567 popup_window.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &popup_window, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1568 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1569 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1570 popup_window.DrawMessageBox(0); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1571 popup_window.uFrameX += 12; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1572 popup_window.uFrameWidth -= 24; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1573 popup_window.uFrameY += 12; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1574 popup_window.uFrameHeight -= 12; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1575 popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1576 popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1; |
2069 | 1577 sprintf(pTmpBuf.data(), "\f%05d%s\f00000\n", Color16(0xFF, 0xFF, 0x9B), pStr); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1578 popup_window.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf.data(), 3); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1579 popup_window.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1580 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1581 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1582 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1583 default: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1584 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1585 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1586 dword_507BF0_is_there_popup_onscreen = 1; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1587 viewparams->bRedrawGameUI = 1; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1588 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1589 int no_rightlick_in_inventory = false; // 0050CDCC |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1590 //----- (00416196) -------------------------------------------------------- |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1591 void Inventory_ItemPopupAndAlchemy() |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1592 { |
1733 | 1593 int potion1_id; // edx@25 |
1594 unsigned int potion2_id; // edi@25 | |
1595 signed int potionID; // edx@27 | |
1596 unsigned int pOut_y; // edx@57 | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1597 double v31; // st7@112 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1598 Vec3_int_ v39; // [sp-18h] [bp-A8h]@83 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1599 GUIWindow message_window; // [sp+Ch] [bp-84h]@137 |
1837 | 1600 POINT cursor; // [sp+78h] [bp-18h]@2 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1601 unsigned int damage_level; // [sp+8Ch] [bp-4h]@23 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1602 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1603 if (no_rightlick_in_inventory) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1604 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1605 |
1837 | 1606 pMouse->GetCursorPos(&cursor); |
1607 int item_pid = (pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF) - 1; | |
1944 | 1608 if (item_pid == -1) //added here to avoid crash |
1609 return; | |
1980 | 1610 ItemGen* item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid]; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1611 |
1837 | 1612 if (cursor.x <= 13 || cursor.x >= 462)//items out of inventory(âåùè âíå èíâåíòàðÿ) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1613 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1614 GameUI_DrawItemInfo(item); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1615 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1616 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1617 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1618 if (!item_pid) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1619 { |
1837 | 1620 int inventory_mouse_x = cursor.x - 14; |
1621 int inventory_mouse_y = cursor.y - 17; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1622 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1623 int mouse_cell_x = inventory_mouse_x / 32; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1624 int mouse_cell_y = inventory_mouse_y / 32; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1625 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1626 if (mouse_cell_x + mouse_cell_y < 0) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1627 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1628 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1629 int inventory_idx = mouse_cell_x + 14 * mouse_cell_y; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1630 if (inventory_idx > 126) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1631 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1632 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1633 if (pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx) == 0) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1634 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1635 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1636 item_pid = pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex(&inventory_idx); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1637 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1638 //check character condition(ïðîâåðêà ñîñòîÿíèÿ ïåðñîíàæà) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1639 if (!pPlayers[uActiveCharacter]->CanAct()) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1640 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1641 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[427], pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);//%s íå â ñîñòîÿíèè %s Îïîçíàòü ïðåäìåòû |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1642 message_window.Hint = pTmpBuf.data(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1643 message_window.uFrameWidth = 384; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1644 message_window.uFrameHeight = 180; |
1837 | 1645 if (cursor.x <= 320 ) |
1646 message_window.uFrameX = cursor.x + 30; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1647 else |
1837 | 1648 message_window.uFrameX = cursor.x - 414; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1649 message_window.uFrameY = 40; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1650 message_window.DrawMessageBox(0); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1651 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1652 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1653 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1654 int alchemy_skill_points = (int8_t)pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY) & 0x3F; |
1733 | 1655 int alchemy_skill_level = SkillToMastery(pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY)); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1656 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1657 // for potion bottle(ïðîñòàÿ áóòûëêà) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1658 if (pParty->pPickedItem.uItemID == ITEM_POTION_BOTTLE) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1659 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1660 GameUI_DrawItemInfo(item); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1661 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1662 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1663 //for recharge potion(çåëüå ïåðåçàðÿäêà) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1664 if (pParty->pPickedItem.uItemID == ITEM_POTION_RECHARGE_ITEM) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1665 { |
1733 | 1666 if (item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION)// all potions |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1667 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1668 if (item->GetItemEquipType() != EQUIP_WAND) // can recharge only wands |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1669 { |
1754 | 1670 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1671 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1672 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1673 |
1733 | 1674 v31 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01; |
1675 if ( v31 < 0.0 ) | |
1676 v31 = 0.0; | |
1677 item->uMaxCharges = (signed __int64)((double)item->uMaxCharges - v31 * (double)item->uMaxCharges); | |
1678 item->uNumCharges = (signed __int64)((double)item->uMaxCharges - v31 * (double)item->uMaxCharges); | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1679 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1680 pMouse->RemoveHoldingItem(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1681 no_rightlick_in_inventory = 1; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1682 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1683 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1684 GameUI_DrawItemInfo(item); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1685 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1686 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1687 // for harden potion(çåëüå çàêàëêà) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1688 else if (pParty->pPickedItem.uItemID == ITEM_POTION_HARDEN_ITEM) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1689 { |
1733 | 1690 if (item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // bottle and all potions |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1691 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1692 if (item->IsBroken() || // cant harden broken items |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1693 item->uItemID >= ITEM_ARTIFACT_PUCK || // cant harden artifacts |
1989 | 1694 item->GetItemEquipType() < EQUIP_SINGLE_HANDED || |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1695 item->GetItemEquipType() > EQUIP_WAND) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1696 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1697 pMouse->RemoveHoldingItem(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1698 no_rightlick_in_inventory = true; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1699 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1700 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1701 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1702 item->uAttributes |= ITEM_AURA_EFFECT_RED | ITEM_HARDENED; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1703 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1704 _50C9A8_item_enchantment_timer = 256; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1705 pMouse->RemoveHoldingItem(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1706 no_rightlick_in_inventory = true; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1707 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1708 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1709 GameUI_DrawItemInfo(item); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1710 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1711 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1712 // several potions(íåñêîëüêî çåëèé) |
1733 | 1713 else if (pParty->pPickedItem.uItemID >= ITEM_POTION_FLAMING_POTION && pParty->pPickedItem.uItemID <= ITEM_POTION_SWIFT_POTION || |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1714 pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1715 { |
1733 | 1716 if ( item->uItemID < ITEM_POTION_BOTTLE || item->uItemID > ITEM_POTION_REJUVENATION) // all potions |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1717 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1718 if (item->uItemID >= ITEM_BLASTER && item->uItemID <= ITEM_LASER_RIFLE || |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1719 item->uItemID >= ITEM_ARTIFACT_PUCK || |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1720 item->IsBroken() || |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1721 item->uSpecEnchantmentType || |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1722 item->uEnchantmentType || |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1723 item->GetItemEquipType() >= EQUIP_ARMOUR) // only melee weapons and bows |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1724 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1725 pMouse->RemoveHoldingItem(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1726 no_rightlick_in_inventory = true; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1727 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1728 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1729 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1730 item->UpdateTempBonus(pParty->uTimePlayed); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1731 if (pParty->pPickedItem.uItemID == ITEM_POTION_SLAYING_POTION) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1732 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1733 item->uSpecEnchantmentType = 40; // of Slaying |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1734 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1735 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1736 else |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1737 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1738 static int _4E2904_enchantment_by_potion_lut[] = |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1739 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1740 164, 93, 22, |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1741 164, 93, 22, |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1742 11, 5, 13, 7, 59 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1743 }; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1744 item->uSpecEnchantmentType = _4E2904_enchantment_by_potion_lut[pParty->pPickedItem.uItemID - 240]; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1745 v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType * 128); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1746 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1747 |
1733 | 1748 item->uExpireTime = pParty->uTimePlayed + v31 * 0.033333335; |
1749 item->uAttributes = alchemy_skill_level | 0x18; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1750 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1751 _50C9A8_item_enchantment_timer = 256; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1752 pMouse->RemoveHoldingItem(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1753 no_rightlick_in_inventory = true; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1754 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1755 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1756 GameUI_DrawItemInfo(item); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1757 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1758 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1759 // use reagents(ïðèìåíåíèå ðåàãåíòîâ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1760 if (pParty->pPickedItem.uItemID >= ITEM_REAGENT_WIDOWSWEEP_BERRIES && pParty->pPickedItem.uItemID <= ITEM_REAGENT_PHILOSOPHERS_STONE && |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1761 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == ITEM_POTION_BOTTLE) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1762 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1763 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = alchemy_skill_points + pParty->pPickedItem.GetDamageDice(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1764 switch ( pParty->pPickedItem.uItemID ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1765 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1766 case 200: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1767 case 201: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1768 case 202: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1769 case 203: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1770 case 204: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1771 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 222; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1772 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1773 case 205: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1774 case 206: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1775 case 207: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1776 case 208: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1777 case 209: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1778 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 223; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1779 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1780 case 210: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1781 case 211: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1782 case 212: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1783 case 213: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1784 case 214: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1785 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 224; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1786 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1787 case 215: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1788 case 216: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1789 case 217: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1790 case 218: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1791 case 219: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1792 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = 221; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1793 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1794 default: |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1795 break; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1796 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1797 pMouse->RemoveHoldingItem(); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1798 no_rightlick_in_inventory = 1; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1799 if ( dword_4E455C ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1800 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1801 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1802 dword_4E455C = 0; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1803 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1804 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1805 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1806 //potions mixing(ñìåøèâàíèå äâóõ çåëèé) |
1733 | 1807 if (pParty->pPickedItem.uItemID >= ITEM_POTION_CATALYST && pParty->pPickedItem.uItemID <= ITEM_POTION_REJUVENATION && |
1808 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID >= ITEM_POTION_CATALYST && | |
1809 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID <= ITEM_POTION_REJUVENATION) | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1810 { |
1733 | 1811 potion1_id = item->uItemID - ITEM_POTION_CURE_WOUNDS; |
1812 potion2_id = pParty->pPickedItem.uItemID - ITEM_POTION_CURE_WOUNDS; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1813 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1814 if ( pParty->pPickedItem.uItemID == ITEM_POTION_CATALYST || item->uItemID == ITEM_POTION_CATALYST ) |
1733 | 1815 potionID = 5; |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1816 else |
1733 | 1817 potionID = pItemsTable->potion_data[potion2_id][potion1_id]; |
1818 damage_level = 0; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1819 if ( alchemy_skill_points ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1820 { |
1733 | 1821 if ( potionID < ITEM_POTION_CURE_DISEASE || potionID > ITEM_POTION_AWAKEN )//< 225 >227 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1822 { |
1733 | 1823 if ( potionID >= ITEM_POTION_HASTE && potionID <= ITEM_POTION_CURE_INSANITY && alchemy_skill_level == 1)//228 >= potionID <= 239 |
1824 damage_level = 2; | |
1825 if ( potionID >= ITEM_POTION_MIGHT_BOOST && potionID <= ITEM_POTION_BODY_RESISTANE && alchemy_skill_level <= 2)//240 >= potionID <= 261 | |
1826 damage_level = 3; | |
1827 if ( potionID >= ITEM_POTION_STONE_TO_FLESH && alchemy_skill_level <= 3 )// 262 < potionID | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1828 damage_level = 4; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1829 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1830 } |
1733 | 1831 else//no skill(íåò íàâûêà) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1832 { |
1733 | 1833 if ( potionID >= ITEM_POTION_CURE_DISEASE && potionID <= ITEM_POTION_AWAKEN )//225 <= v16 <= 227 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1834 damage_level = 1; |
1733 | 1835 if ( potionID >= ITEM_POTION_HASTE && potionID <= ITEM_POTION_CURE_INSANITY )//228 <= v16 <= 239 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1836 damage_level = 2; |
1733 | 1837 if ( potionID >= ITEM_POTION_MIGHT_BOOST && potionID <= ITEM_POTION_BODY_RESISTANE )//240 <= v16 <= 261 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1838 damage_level = 3; |
1733 | 1839 if ( potionID >= ITEM_POTION_STONE_TO_FLESH )//262 <= v16 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1840 damage_level = 4; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1841 } |
1733 | 1842 |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1843 int pOut_x = item_pid + 1; |
1733 | 1844 for ( uint i = 0; i < 126; ++i ) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1845 { |
1733 | 1846 if ( pPlayers[uActiveCharacter]->pInventoryMatrix[i] == pOut_x ) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1847 { |
1733 | 1848 pOut_y = i; |
1849 break; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1850 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1851 } |
1733 | 1852 if ( !potionID ) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1853 { |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1854 GameUI_DrawItemInfo(item); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1855 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1856 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1857 if ( damage_level == 1 ) |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1858 { |
1733 | 1859 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y); |
1860 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 11 + 10, DMGT_FIRE); | |
1861 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); | |
2402 | 1862 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1733 | 1863 v39.z = pParty->vPosition.z + pParty->sEyelevel; |
1864 v39.x = pParty->vPosition.x; | |
1865 v39.y = pParty->vPosition.y; | |
1866 | |
1867 int rot_x, rot_y, rot_z; | |
1868 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z); | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
1869 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0); |
1733 | 1870 if ( dword_4E455C ) |
1871 { | |
1872 if ( pPlayers[uActiveCharacter]->CanAct() ) | |
1873 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0); | |
1874 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé! | |
1875 dword_4E455C = 0; | |
1876 } | |
1877 pMouse->RemoveHoldingItem(); | |
1878 no_rightlick_in_inventory = 1; | |
1879 return; | |
1880 } | |
1881 if ( damage_level == 2 ) | |
1882 { | |
1883 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y); | |
1884 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 71 + 30, DMGT_FIRE); | |
1885 pPlayers[uActiveCharacter]->ItemsEnchant(1); | |
1886 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); | |
2402 | 1887 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1733 | 1888 |
1889 v39.z = pParty->vPosition.z + pParty->sEyelevel; | |
1890 v39.x = pParty->vPosition.x; | |
1891 v39.y = pParty->vPosition.y; | |
1892 | |
1893 int rot_x, rot_y, rot_z; | |
1894 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z); | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
1895 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0); |
1733 | 1896 if ( dword_4E455C ) |
1897 { | |
1898 if ( pPlayers[uActiveCharacter]->CanAct() ) | |
1899 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0); | |
1900 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé! | |
1901 dword_4E455C = 0; | |
1902 } | |
1903 pMouse->RemoveHoldingItem(); | |
1904 no_rightlick_in_inventory = 1; | |
1905 return; | |
1906 } | |
1907 if ( damage_level == 3 ) | |
1908 { | |
1909 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y); | |
1910 pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 201 + 50, DMGT_FIRE); | |
1911 pPlayers[uActiveCharacter]->ItemsEnchant(5); | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1912 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1913 |
2402 | 1914 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1915 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1916 v39.z = pParty->vPosition.z + pParty->sEyelevel; |
1733 | 1917 v39.x = pParty->vPosition.x; |
1918 v39.y = pParty->vPosition.y; | |
1919 | |
1920 int rot_x, rot_y, rot_z; | |
1921 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z); | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
1922 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0); |
1733 | 1923 if ( dword_4E455C ) |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1924 { |
1733 | 1925 if ( pPlayers[uActiveCharacter]->CanAct() ) |
1926 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0); | |
1927 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé! | |
1928 dword_4E455C = 0; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1929 } |
1733 | 1930 pMouse->RemoveHoldingItem(); |
1931 no_rightlick_in_inventory = 1; | |
1932 return; | |
1933 } | |
1934 if ( damage_level == 4 ) | |
1935 { | |
1936 pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y); | |
2185 | 1937 pPlayers[uActiveCharacter]->SetCondition(Condition_Eradicated, 0); |
1733 | 1938 pPlayers[uActiveCharacter]->ItemsEnchant(0); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1939 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1940 |
2402 | 1941 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1942 |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1943 v39.z = pParty->vPosition.z + pParty->sEyelevel; |
1733 | 1944 v39.x = pParty->vPosition.x; |
1945 v39.y = pParty->vPosition.y; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1946 |
1733 | 1947 int rot_x, rot_y, rot_z; |
1948 Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39, &rot_x, &rot_y, &rot_z); | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2253
diff
changeset
|
1949 SpriteObject::sub_42F7EB_DropItemAt(0x41Bu, rot_x, rot_y, rot_z, 0, 1, 0, 0, 0); |
1733 | 1950 if ( dword_4E455C ) |
1951 { | |
1952 if ( pPlayers[uActiveCharacter]->CanAct() ) | |
1953 pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0); | |
1954 ShowStatusBarString(pGlobalTXT_LocalizationStrings[444], 2);//Îé! | |
1955 dword_4E455C = 0; | |
1956 } | |
1957 pMouse->RemoveHoldingItem(); | |
1958 no_rightlick_in_inventory = 1; | |
1959 return; | |
1960 } | |
1961 if ( damage_level == 0 ) | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1962 { |
1733 | 1963 if ( alchemy_skill_points ) |
1964 { | |
1965 if ( pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == 221 || pParty->pPickedItem.uItemID == 221 )//catalyst(êàòàëèçàòîð) | |
1966 { | |
1967 if ( pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID == 221 ) | |
1968 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = pParty->pPickedItem.uItemID; | |
1969 if ( pParty->pPickedItem.uItemID == 221 ) | |
1970 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = pParty->pPickedItem.uEnchantmentType; | |
1971 } | |
1972 else | |
1973 { | |
1974 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID = potionID; | |
1975 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType = (pParty->pPickedItem.uEnchantmentType | |
1976 + pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uEnchantmentType) / 2; | |
1977 pPlayers[uActiveCharacter]->SetVariable(VAR_AutoNotes, pItemsTable->potion_note[potion1_id][potion2_id]); | |
1978 } | |
1979 int bottle = pPlayers[uActiveCharacter]->AddItem(-1, 220);//áóòûëêà | |
1980 if ( bottle ) | |
1981 pPlayers[uActiveCharacter]->pOwnItems[bottle - 1].uAttributes = ITEM_IDENTIFIED; | |
1982 if ( !(pItemsTable->pItems[pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uItemID].uItemID_Rep_St) ) | |
1983 pPlayers[uActiveCharacter]->pInventoryItemList[item_pid].uAttributes |= 1; | |
1984 if ( !dword_4E455C ) | |
1985 { | |
1986 pMouse->RemoveHoldingItem(); | |
1987 no_rightlick_in_inventory = 1; | |
1988 return; | |
1989 } | |
1990 pPlayers[uActiveCharacter]->PlaySound(SPEECH_DO_POTION_FINE, 0); | |
1991 dword_4E455C = 0; | |
1992 pMouse->RemoveHoldingItem(); | |
1993 no_rightlick_in_inventory = 1; | |
1994 return; | |
1995 } | |
1996 GameUI_DrawItemInfo(item); | |
1997 return; | |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1998 } |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
1999 } |
1733 | 2000 GameUI_DrawItemInfo(item); |
1729
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
2001 return; |
f44b6e02e81c
pop-up window in character(paperdill) window, alchemy
Ritor1
parents:
1725
diff
changeset
|
2002 } |
1754 | 2003 |
2355 | 2004 |
2005 //----- (0045828B) -------------------------------------------------------- | |
2006 unsigned int __fastcall GetSpellColor(signed int a1) | |
2007 { | |
2008 if ( a1 == 0 ) | |
2009 return Color16(0, 0, 0); | |
2010 if ( a1 < 12 ) | |
2011 return Color16(255, 85, 0); | |
2012 if ( a1 < 23 ) | |
2013 return Color16(150, 212, 255); | |
2014 if ( a1 < 34 ) | |
2015 return Color16(0, 128, 255); | |
2016 if ( a1 < 45 ) | |
2017 return Color16(128, 128, 128); | |
2018 if ( a1 < 56 ) | |
2019 return Color16(225, 225, 225); | |
2020 if ( a1 < 67 ) | |
2021 return Color16(235, 15, 255); | |
2022 if ( a1 < 78 ) | |
2023 return Color16(255, 128, 0); | |
2024 if ( a1 < 89 ) | |
2025 return Color16(255, 255, 155); | |
2026 if ( a1 < 100 ) | |
2027 return Color16(192, 192, 240); | |
2375 | 2028 else |
2029 __debugbreak(); | |
2463 | 2030 } |
2031 | |
2032 //----- (004B46F8) -------------------------------------------------------- | |
2033 __int64 GetExperienceRequiredForLevel(int level) | |
2034 { | |
2035 __int64 v1; // eax@1 | |
2036 int i; // edx@1 | |
2037 | |
2038 v1 = 0; | |
2039 for (i = 0; i < level; ++i) | |
2040 v1 += i + 1; | |
2041 return 1000 * v1; | |
2042 } |