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