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