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