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