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