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