World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
UIPopup.cpp
См. документацию.
1 #define _CRTDBG_MAP_ALLOC
2 #define _CRT_SECURE_NO_WARNINGS
3 #include <stdlib.h>
4 
5 #include "Engine/Engine.h"
6 #include "Engine/Events.h"
7 #include "Engine/LOD.h"
8 #include "Engine/Localization.h"
9 #include "Engine/Party.h"
10 #include "Engine/Time.h"
11 
16 #include "Engine/Graphics/Vis.h"
17 
18 #include "Engine/Objects/Actor.h"
19 #include "Engine/Objects/Chest.h"
22 
23 #include "IO/Mouse.h"
24 
25 #include "GUI/GUIButton.h"
26 #include "GUI/GUIFont.h"
27 #include "GUI/UI/Books/MapBook.h"
28 #include "GUI/UI/UIPopup.h"
29 #include "GUI/UI/UIShops.h"
30 #include "GUI/UI/UIStatusBar.h"
31 
32 #include "GUI/UI/UICharacter.h"
33 
35 
37 
39 
40 Texture *parchment = nullptr;
41 Image *messagebox_corner_x = nullptr; // 5076AC
42 Image *messagebox_corner_y = nullptr; // 5076B4
43 Image *messagebox_corner_z = nullptr; // 5076A8
44 Image *messagebox_corner_w = nullptr; // 5076B0
45 Image *messagebox_border_top = nullptr; // 507698
46 Image *messagebox_border_bottom = nullptr; // 5076A4
47 Image *messagebox_border_left = nullptr; // 50769C
48 Image *messagebox_border_right = nullptr; // 5076A0
49 
50 //----- (004179BC) --------------------------------------------------------
51 void CharacterUI_DrawTooltip(const char *title, String &content) {
52  GUIWindow popup_window; // [sp+Ch] [bp-5Ch]@1
53 
54  Point pt = pMouse->GetCursorPos();
55 
56  memset(&popup_window, 0, 0x54u);
57  popup_window.uFrameWidth = 384;
58  popup_window.uFrameHeight = 256;
59  popup_window.uFrameX = 128;
60  popup_window.uFrameY = pt.y + 30;
61  popup_window.uFrameHeight =
62  pFontSmallnum->CalcTextHeight(content, popup_window.uFrameWidth, 24) +
63  2 * pFontLucida->GetHeight() + 24;
64  popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
65  popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
66  popup_window.DrawMessageBox(0);
67 
68  popup_window.uFrameX += 12;
69  popup_window.uFrameWidth -= 24;
70  popup_window.uFrameY += 12;
71  popup_window.uFrameHeight -= 12;
72  popup_window.uFrameZ = popup_window.uFrameX + popup_window.uFrameWidth - 1;
73  popup_window.uFrameW = popup_window.uFrameY + popup_window.uFrameHeight - 1;
74 
75  auto colored_title = StringPrintf(
76  "\f%05d%s\f00000\n", ui_character_tooltip_header_default_color, title);
77  popup_window.DrawTitleText(pFontCreate, 0, 0, 0, colored_title, 3);
78  popup_window.DrawText(
79  pFontSmallnum, 1, pFontLucida->GetHeight(), 0, content, 0, 0,
80  0); // popup_window.uFrameY + popup_window.uFrameHeight
81 }
82 
83 void CharacterUI_DrawTooltip(const char *title, const char *content) {
84  String content_str = String(content);
85  CharacterUI_DrawTooltip(title, content_str);
86 }
87 
88 //----- (004151D9) --------------------------------------------------------
89 void DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth,
90  unsigned int uHeight) {
91  unsigned int uNumTiles; // [sp+2Ch] [bp-Ch]@6
92  int coord_x; // [sp+2Ch] [bp-Ch]@3
93  int coord_y; // [sp+34h] [bp-4h]@5
94 
95  if (!parchment) return;
96 
97  render->SetUIClipRect(uX, uY, uX + uWidth, uY + uHeight);
98 
99  unsigned int parchment_width = parchment->GetWidth();
100  unsigned int parchment_height = parchment->GetHeight();
101 
102  uNumTiles = uWidth / parchment_width;
103  if (uWidth % parchment_width) ++uNumTiles;
104  coord_y = uY;
105  for (uint j = 0; j <= uHeight / parchment_height; j++) {
106  coord_x = uX - parchment_width;
107  for (uint i = uNumTiles + 1; i; --i) {
108  coord_x += parchment_width;
109  render->DrawTextureNew(coord_x / 640.0f, coord_y / 480.0f,
110  parchment);
111  }
112  coord_y += parchment_height;
113  }
114 
115  render->DrawTextureAlphaNew(uX / 640.0f, uY / 480.0f, messagebox_corner_x);
116  render->DrawTextureAlphaNew(
117  uX / 640.0f, (uY + uHeight - messagebox_corner_y->GetHeight()) / 480.0f,
119  render->DrawTextureAlphaNew(
120  (uX + uWidth - messagebox_corner_z->GetWidth()) / 640.0f, uY / 480.0f,
122  render->DrawTextureAlphaNew(
123  (uX + uWidth - messagebox_corner_z->GetWidth()) / 640.0f,
124  (uY + uHeight - messagebox_corner_y->GetHeight()) / 480.0f,
126 
127  if (uWidth >
129  render->SetUIClipRect(uX + messagebox_corner_x->GetWidth(), uY,
130  uX + uWidth - messagebox_corner_z->GetWidth(),
131  uY + uHeight);
132 
133  // horizontal borders
134  for (unsigned int x = uX + messagebox_corner_x->GetWidth();
137  render->DrawTextureAlphaNew(x / 640.0f, uY / 480.0f,
139  render->DrawTextureAlphaNew(
140  x / 640.0f,
141  (uY + uHeight - messagebox_border_bottom->GetHeight()) / 480.0f,
143  }
144  }
145 
146  // vertical borders
147  if (uHeight >
149  render->SetUIClipRect(uX, uY + messagebox_corner_x->GetHeight(),
150  uX + uWidth,
151  uY + uHeight - messagebox_corner_y->GetHeight());
152 
153  for (unsigned int y = uY + messagebox_corner_x->GetHeight();
156  render->DrawTextureAlphaNew(uX / 640.0f, y / 480.0f,
158  render->DrawTextureAlphaNew(
159  (uX + uWidth - messagebox_border_right->GetWidth() - 1) /
160  640.0f,
161  y / 480.0f, messagebox_border_right);
162  }
163  }
164  render->ResetUIClipRect();
165 }
166 
167 //----- (0041D895) --------------------------------------------------------
168 void GameUI_DrawItemInfo(struct ItemGen *inspect_item) {
169  unsigned int v2; // eax@3
170  const char *v28; // edi@69
171  int v34; // esi@81
172  char out_text[300]; // [sp+8h] [bp-270h]@40
173  SummonedItem v67;
174  int v77; // [sp+200h] [bp-78h]@12
175  int v78; // [sp+204h] [bp-74h]@5
176  GUIWindow iteminfo_window; // [sp+208h] [bp-70h]@2
177  int v81; // [sp+264h] [bp-14h]@5
178  PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18
179  char *v84;
180  int v85;
181  char *Str; // [sp+270h] [bp-8h]@65
182 
183  int r_mask = 0xF800;
184  int g_mask = 0x7E0;
185  int b_mask = 0x1F;
186 
187  if (!inspect_item->uItemID) return;
188 
189  auto inspect_item_image =
190  assets->GetImage_ColorKey(inspect_item->GetIconName(), 0x7FF);
191 
192  iteminfo_window.sHint.clear();
193  iteminfo_window.uFrameWidth = 384;
194  iteminfo_window.uFrameHeight = 180;
195  iteminfo_window.uFrameY = 40;
196 
197  Point pt = pMouse->GetCursorPos();
198  if (pt.x <= 320)
199  v2 = pt.x + 30;
200  else
201  v2 = pt.x - iteminfo_window.uFrameWidth - 30;
202  iteminfo_window.uFrameX = v2;
203  v78 = 100 - inspect_item_image->GetWidth();
204  v81 = 144 - inspect_item_image->GetHeight();
205  if (v78 > 0) v78 = v78 / 2;
206  if (v81 <= 0)
207  v81 = 0;
208  else
209  v81 = v81 / 2;
210  if (!pItemsTable->pItems[inspect_item->uItemID].uItemID_Rep_St)
211  inspect_item->SetIdentified();
212  v77 = 0;
213  if (inspect_item->GetItemEquipType() == EQUIP_GOLD)
214  v77 = inspect_item->special_enchantment;
215  if (uActiveCharacter) {
216  // try to identify
217  if (!inspect_item->IsIdentified()) {
218  if (pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1)
219  inspect_item->SetIdentified();
220  v83 = SPEECH_9;
221  if (!inspect_item->IsIdentified()) {
223  localization->GetString(446)); // Identify Failed
224  } else {
225  v83 = SPEECH_8;
226  if (inspect_item->GetValue() <
227  100 * (pPlayers[uActiveCharacter]->uLevel + 5))
228  v83 = SPEECH_7;
229  }
230  if (dword_4E455C) {
231  pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83,
232  0);
233  dword_4E455C = 0;
234  }
235  }
236  inspect_item->UpdateTempBonus(pParty->GetPlayingTime());
237  if (inspect_item->IsBroken()) {
238  if (pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1)
239  inspect_item->uAttributes =
240  inspect_item->uAttributes & 0xFFFFFFFD | 1;
241  v83 = SPEECH_11;
242  if (!inspect_item->IsBroken())
243  v83 = SPEECH_10;
244  else
246  localization->GetString(448)); // Repair Failed
247  if (dword_4E455C) {
248  pPlayers[uActiveCharacter]->PlaySound(v83, 0);
249  dword_4E455C = 0;
250  }
251  }
252  }
253  if (inspect_item->IsBroken()) {
254  iteminfo_window.DrawMessageBox(0);
255  render->SetUIClipRect(
256  iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
257  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12,
258  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
259  iteminfo_window.uFrameWidth -= 24;
260  iteminfo_window.uFrameHeight -= 12;
261  iteminfo_window.uFrameZ =
262  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
263  iteminfo_window.uFrameW =
264  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
265 
266  render->DrawTransparentRedShade(
267  (iteminfo_window.uFrameX + v78) / 640.0f,
268  (v81 + iteminfo_window.uFrameY + 30) / 480.0f, inspect_item_image);
269 
270  iteminfo_window.DrawTitleText(
271  pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu),
272  inspect_item->GetDisplayName().c_str(), 3);
273  iteminfo_window.DrawTitleText(
274  pFontArrus, 0x64u,
275  ((signed int)iteminfo_window.uFrameHeight >> 1) -
277  iteminfo_window.uFrameWidth, 0) /
278  2,
279  Color16(0xFFu, 0x19u, 0x19u), localization->GetString(32),
280  3); // "Broken Item"
281  render->ResetUIClipRect();
282 
283  if (inspect_item_image) {
284  inspect_item_image->Release();
285  inspect_item_image = nullptr;
286  }
287 
288  return;
289  }
290  if (!inspect_item->IsIdentified()) {
291  iteminfo_window.DrawMessageBox(0);
292  render->SetUIClipRect(
293  iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
294  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12,
295  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
296  iteminfo_window.uFrameWidth -= 24;
297  iteminfo_window.uFrameHeight -= 12;
298  iteminfo_window.uFrameZ =
299  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
300  iteminfo_window.uFrameW =
301  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
302  render->DrawTextureAlphaNew(
303  (iteminfo_window.uFrameX + v78) / 640.0f,
304  (v81 + iteminfo_window.uFrameY + 30) / 480.0f, inspect_item_image);
305  iteminfo_window.DrawTitleText(
306  pFontArrus, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu),
307  pItemsTable->pItems[inspect_item->uItemID].pUnidentifiedName, 3);
308  iteminfo_window.DrawTitleText(
309  pFontArrus, 0x64u,
310  ((int)iteminfo_window.uFrameHeight >> 1) -
312  iteminfo_window.uFrameWidth, 0) /
313  2,
314  Color16(0xFFu, 0x19u, 0x19u), localization->GetString(232),
315  3); // Not Identified
316  render->ResetUIClipRect();
317 
318  if (inspect_item_image) {
319  inspect_item_image->Release();
320  inspect_item_image = nullptr;
321  }
322  return;
323  }
324 
326  463, pItemsTable->pItems[inspect_item->uItemID]
327  .pUnidentifiedName); // "Type: %s"
328 
329  strcpy(out_text, str.c_str());
330  out_text[100] = 0;
331  out_text[200] = 0;
332 
333  switch (inspect_item->GetItemEquipType()) {
334  case EQUIP_SINGLE_HANDED:
335  case EQUIP_TWO_HANDED: {
336  sprintf(out_text + 100, "%s: +%d %s: %dd%d",
337  localization->GetString(18), // Attack
338  (int)inspect_item->GetDamageMod(),
339  localization->GetString(53),
340  (int)inspect_item->GetDamageDice(),
341  (int)inspect_item->GetDamageRoll()); // "Damage"
342  if (inspect_item->GetDamageMod()) {
343  char mod[16];
344  sprintf(mod, "+%d", (int)inspect_item->GetDamageMod());
345  strcat(out_text + 100, mod);
346  }
347  break;
348  }
349 
350  case EQUIP_BOW:
351  sprintf(out_text + 100, "%s: +%d %s: %dd%d",
352  localization->GetString(203), // "Shoot"
353  (int)inspect_item->GetDamageMod(),
354  localization->GetString(53), // "Damage"
355  (int)inspect_item->GetDamageDice(),
356  (int)inspect_item->GetDamageRoll());
357  if (inspect_item->GetDamageMod()) {
358  char mod[16];
359  sprintf(mod, "+%d", (int)inspect_item->GetDamageMod());
360  strcat(out_text + 100, mod);
361  }
362  break;
363 
364  case EQUIP_ARMOUR:
365  case EQUIP_SHIELD:
366  case EQUIP_HELMET:
367  case EQUIP_BELT:
368  case EQUIP_CLOAK:
369  case EQUIP_GAUNTLETS:
370  case EQUIP_BOOTS:
371  case EQUIP_RING:
372  case EQUIP_AMULET:
373  if (inspect_item->GetDamageDice()) // "Armor"
374  sprintf(out_text + 100, "%s: +%d", localization->GetString(11),
375  inspect_item->GetDamageDice() +
376  inspect_item->GetDamageMod());
377  break;
378  }
379 
380  if (!v77) {
381  if (inspect_item->GetItemEquipType() ==
382  EQUIP_POTION) { // this is CORRECT! do not move to switch!
383  if (inspect_item->uEnchantmentType)
384  sprintf(out_text + 200, "%s: %d", localization->GetString(449),
385  inspect_item->uEnchantmentType); // "Power"
386  } else if (inspect_item->GetItemEquipType() == EQUIP_REAGENT) {
387  sprintf(out_text + 200, "%s: %d", localization->GetString(449),
388  inspect_item->GetDamageDice()); // "Power"
389  } else if (inspect_item->uEnchantmentType) {
390  sprintf(
391  out_text + 200, "%s: %s +%d", localization->GetString(210),
392  pItemsTable->pEnchantments[inspect_item->uEnchantmentType - 1]
393  .pBonusStat,
394  inspect_item->m_enchantmentStrength); // "Special"
395  } else if (inspect_item->special_enchantment) {
396  sprintf(
397  out_text + 200, "%s: %s", localization->GetString(210),
399  ->pSpecialEnchantments[inspect_item->special_enchantment -
400  1]
401  .pBonusStatement);
402  } else if (inspect_item->uNumCharges) {
403  sprintf(out_text + 200, "%s: %lu", localization->GetString(464),
404  inspect_item->uNumCharges); // "Charges"
405  }
406  }
407  iteminfo_window.uFrameWidth -= 12;
408  iteminfo_window.uFrameZ =
409  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
410  iteminfo_window.uFrameW =
411  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
412  Str = (char *)(3 * (pFontArrus->GetHeight() + 8));
413  v84 = &out_text[0];
414  for (uint i = 1; i <= 3; i++) {
415  if (*v84)
416  Str += pFontComic->CalcTextHeight(v84, iteminfo_window.uFrameWidth,
417  100) +
418  3;
419  v84 += 100;
420  }
421  v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription;
422  if (*v28)
424  pItemsTable->pItems[inspect_item->uItemID].pDescription,
425  iteminfo_window.uFrameWidth, 100);
426  iteminfo_window.uFrameHeight =
427  assets->GetImage_ColorKey(inspect_item->GetIconName(), 0x7FF)
428  ->GetHeight() +
429  v81 + 54;
430  if ((signed int)Str > (signed int)iteminfo_window.uFrameHeight)
431  iteminfo_window.uFrameHeight = (unsigned int)Str;
432  if (inspect_item->uAttributes & ITEM_TEMP_BONUS &&
433  (inspect_item->special_enchantment || inspect_item->uEnchantmentType))
434  iteminfo_window.uFrameHeight += pFontComic->GetHeight();
435  v85 = 0;
436  if (pFontArrus->GetHeight()) {
437  iteminfo_window.uFrameWidth -= 24;
438  if (pFontArrus->CalcTextHeight(inspect_item->GetIdentifiedName(),
439  iteminfo_window.uFrameWidth, 0) /
440  (signed int)pFontArrus->GetHeight())
441  v85 = pFontArrus->GetHeight();
442  iteminfo_window.uFrameWidth += 24;
443  }
444  iteminfo_window.uFrameWidth += 12;
445  iteminfo_window.uFrameHeight += (unsigned int)v85;
446  iteminfo_window.uFrameW =
447  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
448  iteminfo_window.uFrameZ =
449  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
450  iteminfo_window.DrawMessageBox(0);
451  render->SetUIClipRect(
452  iteminfo_window.uFrameX + 12, iteminfo_window.uFrameY + 12,
453  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 12,
454  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 12);
455  iteminfo_window.uFrameWidth -= 12;
456  iteminfo_window.uFrameHeight -= 12;
457  iteminfo_window.uFrameZ =
458  iteminfo_window.uFrameX + iteminfo_window.uFrameWidth - 1;
459  iteminfo_window.uFrameW =
460  iteminfo_window.uFrameY + iteminfo_window.uFrameHeight - 1;
461  render->DrawTextureAlphaNew((iteminfo_window.uFrameX + v78) / 640.0f,
462  (iteminfo_window.uFrameY +
463  (signed int)(iteminfo_window.uFrameHeight -
464  inspect_item_image->GetHeight()) /
465  2) /
466  480.0f,
467  inspect_item_image);
468 
469  v34 = (int)(v85 + 35);
470  Str = out_text;
471  for (uint i = 1; i <= 3; i++) {
472  if (*Str) {
473  iteminfo_window.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0);
474  v34 += pFontComic->CalcTextHeight(Str, iteminfo_window.uFrameWidth,
475  100, 0) +
476  3;
477  }
478  Str += 100;
479  }
480  v28 = pItemsTable->pItems[inspect_item->uItemID].pDescription;
481  if (*v28)
482  iteminfo_window.DrawText(pFontSmallnum, 100, v34, 0, v28, 0, 0, 0);
483  iteminfo_window.uFrameX += 12;
484  iteminfo_window.uFrameWidth -= 24;
485  iteminfo_window.DrawTitleText(pFontArrus, 0, 0xCu,
486  Color16(0xFFu, 0xFFu, 0x9Bu),
487  inspect_item->GetIdentifiedName(), 3);
488  iteminfo_window.uFrameWidth += 24;
489  iteminfo_window.uFrameX -= 12;
490  if (v77) {
491  auto txt = StringPrintf("%s: %lu", localization->GetString(465),
492  v77); // Value
493  iteminfo_window.DrawText(
494  pFontComic, 100,
495  iteminfo_window.uFrameHeight - pFontComic->GetHeight(), 0, txt, 0,
496  0, 0);
497  render->ResetUIClipRect();
498  } else {
499  if ((inspect_item->uAttributes & ITEM_TEMP_BONUS) &&
500  (inspect_item->special_enchantment ||
501  inspect_item->uEnchantmentType)) {
502  v67.Initialize(inspect_item->expirte_time -
504 
505  String txt4 = "Duration:";
506  Str = (char *)(v67.field_18_expire_year - game_starting_year);
507  if (v67.field_18_expire_year != 1168) {
508  txt4 += StringPrintf(
509  " %d:yr", v67.field_18_expire_year - game_starting_year);
510  }
511 
512  if ((((v67.field_14_exprie_month || Str) &&
513  ((txt4 +=
514  StringPrintf(" %d:mo", v67.field_14_exprie_month),
515  v67.field_14_exprie_month) ||
516  Str) ||
517  v67.field_C_expire_day) &&
518  ((txt4 += StringPrintf(" %d:dy", v67.field_C_expire_day),
519  v67.field_14_exprie_month) ||
520  Str || v67.field_C_expire_day) ||
521  v67.field_8_expire_hour) &&
522  ((txt4 += StringPrintf(" %d:hr", v67.field_8_expire_hour),
523  v67.field_14_exprie_month) ||
524  Str || v67.field_C_expire_day ||
525  v67.field_8_expire_hour) ||
526  v67.field_4_expire_minute) {
527  txt4 += StringPrintf(" %d:mn", v67.field_4_expire_minute);
528  }
529  iteminfo_window.DrawText(
530  pFontComic, 100,
531  iteminfo_window.uFrameHeight - 2 * pFontComic->GetHeight(), 0,
532  txt4.data(), 0, 0, 0);
533  }
534 
535  auto txt2 = StringPrintf("%s: %lu", localization->GetString(465),
536  inspect_item->GetValue());
537  iteminfo_window.DrawText(
538  pFontComic, 100,
539  iteminfo_window.uFrameHeight - pFontComic->GetHeight(), 0,
540  txt2.data(), 0, 0, 0);
541 
542  String txt3;
543  if (inspect_item->uAttributes & ITEM_STOLEN) {
544  txt3 = localization->GetString(187); // "Stolen"
545  } else {
546  if (!(inspect_item->uAttributes & ITEM_HARDENED)) {
547  render->ResetUIClipRect();
548  return;
549  }
550  txt3 = localization->GetString(651); // "Hardened"
551  }
552 
553  int tempatt = (inspect_item->uAttributes & 0xFFFF0000) | r_mask;
554 
555  iteminfo_window.DrawText(
556  pFontComic, pFontComic->GetLineWidth(txt2.data()) + 132,
557  iteminfo_window.uFrameHeight - pFontComic->GetHeight(), tempatt,
558  txt3, 0, 0, 0);
559  render->ResetUIClipRect();
560  }
561 }
562 
563 void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *pWindow) {
564  bool monster_full_informations = false;
565  static Actor pMonsterInfoUI_Doll;
566  if (!uActiveCharacter) {
567  uActiveCharacter = 1;
568  }
569 
570  int Popup_Y_Offset =
571  monster_popup_y_offsets[(pActors[uActorID].pMonsterInfo.uID - 1) / 3] -
572  40;
573 
574  uint16_t v9 = 0;
575  if (pActors[uActorID].pMonsterInfo.uID ==
576  pMonsterInfoUI_Doll.pMonsterInfo.uID) {
577  v9 = pMonsterInfoUI_Doll.uCurrentActionLength;
578  } else {
579  memcpy(&pMonsterInfoUI_Doll, &pActors[uActorID],
580  sizeof(pMonsterInfoUI_Doll));
581  pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
582  pMonsterInfoUI_Doll.uCurrentActionTime = 0;
583  v9 = rand() % 256 + 128;
584  pMonsterInfoUI_Doll.uCurrentActionLength = v9;
585  }
586 
587  if (pMonsterInfoUI_Doll.uCurrentActionTime > v9) {
588  pMonsterInfoUI_Doll.uCurrentActionTime = 0;
589  if (pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored ||
590  pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) {
591  pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing;
592  pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128;
593  } else {
594  // rand();
595  pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored;
596  if ((pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 ||
597  pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) &&
598  (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 ||
599  pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) &&
600  rand() % 30 < 100)
601  pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee;
602  pMonsterInfoUI_Doll.uCurrentActionLength =
603  8 *
605  ->pSpriteSFrames[pActors[uActorID].pSpriteIDs
606  [(signed __int16)pMonsterInfoUI_Doll
607  .uCurrentActionAnimation]]
608  .uAnimLength;
609  }
610  }
611 
612  Rect doll_rect = {pWindow->uFrameX + 13, pWindow->uFrameY + 52,
613  (pWindow->uFrameX + 13) + 128,
614  (pWindow->uFrameY + 52) + 128};
615  {
616  SpriteFrame *Portrait_Sprite = pSpriteFrameTable->GetFrame(
617  pActors[uActorID]
618  .pSpriteIDs[pMonsterInfoUI_Doll.uCurrentActionAnimation],
619  pMonsterInfoUI_Doll.uCurrentActionTime);
620 
621  // Draw portrait border
622  render->ResetUIClipRect();
623  render->FillRectFast(doll_rect.x, doll_rect.y, 128, 128, Color16(0, 0, 0));
624  render->RasterLine2D(
625  doll_rect.x - 1, doll_rect.y - 1, doll_rect.z + 1, doll_rect.y - 1,
626  Color16(0xE1u, 255, 0x9Bu)); // горизонтальная верхняя линия
627  render->RasterLine2D(
628  doll_rect.x - 1, doll_rect.w + 1, doll_rect.x - 1, doll_rect.y - 1,
629  Color16(0xE1u, 255, 0x9Bu)); // горизонтальная нижняя линия
630  render->RasterLine2D(
631  doll_rect.z + 1, doll_rect.w + 1, doll_rect.x - 1, doll_rect.w + 1,
632  Color16(0xE1u, 255, 0x9Bu)); // левая вертикальная линия
633  render->RasterLine2D(
634  doll_rect.z + 1, doll_rect.y - 1, doll_rect.z + 1, doll_rect.w + 1,
635  Color16(0xE1u, 255, 0x9Bu)); // правая вертикальная линия
636 
637  // Draw portrait
638  render->DrawMonsterPortrait(doll_rect, Portrait_Sprite, Popup_Y_Offset);
639  }
640 
641  // Draw name and profession
642  String str;
643  if (pActors[uActorID].sNPC_ID) {
644  if (GetNPCData(pActors[uActorID].sNPC_ID)->uProfession)
645  str = localization->FormatString(
646  429, GetNPCData(pActors[uActorID].sNPC_ID)->pName,
648  GetNPCData(pActors[uActorID].sNPC_ID)
649  ->uProfession)); // "%s the %s" / ^Pi[%s] %s
650  else
651  str = GetNPCData(pActors[uActorID].sNPC_ID)->pName;
652  } else {
653  if (pActors[uActorID].dword_000334_unique_name)
654  str =
656  ->pPlaceStrings[pActors[uActorID].dword_000334_unique_name];
657  else
658  str =
659  pMonsterStats->pInfos[pActors[uActorID].pMonsterInfo.uID].pName;
660  }
661  pWindow->DrawTitleText(pFontComic, 0, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu),
662  str, 3);
663 
664  // health bar
665  Actor::DrawHealthBar(&pActors[uActorID], pWindow);
666 
667  bool normal_level = false;
668  bool expert_level = false;
669  bool master_level = false;
670  bool grandmaster_level = false;
671  bool for_effects = false;
672 
673  int skill_points = 0;
674  unsigned int skill_level = 0;
675 
676  pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed;
677  if (pPlayers[uActiveCharacter]->GetActualSkillLevel(
679  skill_points =
680  (unsigned __int8)pPlayers[uActiveCharacter]->GetActualSkillLevel(
682  skill_level = pPlayers[uActiveCharacter]->GetActualSkillMastery(
684  1;
685  if (skill_level == 0) { // (normal)
686  if (skill_points + 10 >= pActors[uActorID].pMonsterInfo.uLevel)
687  normal_level = 1;
688  } else if (skill_level == 1) { // (expert)
689  if (2 * skill_points + 10 >=
690  pActors[uActorID].pMonsterInfo.uLevel) {
691  normal_level = 1;
692  expert_level = 1;
693  }
694  } else if (skill_level == 2) { // (master)
695  if (3 * skill_points + 10 >=
696  pActors[uActorID].pMonsterInfo.uLevel) {
697  normal_level = 1;
698  expert_level = 1;
699  master_level = 1;
700  }
701  } else if (skill_level == 3) { // grandmaster
702  normal_level = 1;
703  expert_level = 1;
704  master_level = 1;
705  grandmaster_level = 1;
706  }
707  }
708 
709  PlayerSpeech speech;
710  if (pActors[uActorID].uAIState != Dead &&
711  pActors[uActorID].uAIState != Dying &&
713  pPlayers[uActiveCharacter]->GetActualSkillLevel(
715  if (normal_level | expert_level | master_level | grandmaster_level) {
716  if (pActors[uActorID].pMonsterInfo.uLevel >=
717  pPlayers[uActiveCharacter]->uLevel - 5)
719  else
721  } else {
723  }
724  pPlayers[uActiveCharacter]->PlaySound(speech, 0);
725  }
726 
727  if ((signed int)(pParty->pPlayers[uActiveCharacter - 1]
728  .GetActualSkillMastery(PLAYER_SKILL_MONSTER_ID)) >= 3)
729  for_effects = 1;
730 
731  if (monster_full_informations == true) {
732  normal_level = 1; //
733  expert_level = 1; //
734  master_level = 1; //
735  grandmaster_level = 1; //
736  for_effects = 1;
737  }
738 
739  int pTextHeight = 0;
740  const char *pText = nullptr;
741  int pTextColorID = 0;
742  pWindow->DrawText(pFontSmallnum, 12, 196, Color16(0xE1u, 255, 0x9Bu),
743  localization->GetString(631), 0, 0, 0); // Effects
744  if (!for_effects && false) {
745  pWindow->DrawText(pFontSmallnum, 28, pFontSmallnum->GetHeight() + 193,
746  Color16(0xE1u, 255, 0x9Bu),
747  localization->GetString(630), 0, 0, 0); //?
748  } else {
749  pText = "";
750  pTextHeight = pFontSmallnum->GetHeight() + 193;
751  for (uint i = 1; i <= 21; ++i) {
752  if (pActors[uActorID].pActorBuffs[i].Active()) {
753  switch (i) {
754  case ACTOR_BUFF_CHARM:
755  pTextColorID = 60;
756  pText = localization->GetString(591); // Charmed
757  break;
758  case ACTOR_BUFF_SUMMONED:
759  pTextColorID = 82;
760  pText = localization->GetString(649); // Summoned
761  break;
762  case ACTOR_BUFF_SHRINK:
763  pTextColorID = 92;
764  pText = localization->GetString(592); // Shrunk
765  break;
766  case ACTOR_BUFF_AFRAID:
767  pTextColorID = 63;
768  pText = localization->GetString(4); // Afraid
769  break;
770  case ACTOR_BUFF_STONED:
771  pText = localization->GetString(220); // Stoned
772  pTextColorID = 81;
773  break;
775  pText = localization->GetString(162); // Paralyzed
776  pTextColorID = 81;
777  break;
778  case ACTOR_BUFF_SLOWED:
779  pText = localization->GetString(593); // Slowed
780  pTextColorID = 35;
781  break;
782  case ACTOR_BUFF_BERSERK:
783  pText = localization->GetString(608); // Berserk
784  pTextColorID = 62;
785  break;
788  pText = "";
789  pTextColorID = 0;
790  continue;
791  case ACTOR_BUFF_FATE:
792  pTextColorID = 47;
793  pText = localization->GetString(221); // Fate
794  break;
795  case ACTOR_BUFF_ENSLAVED:
796  pTextColorID = 66;
797  pText = localization->GetString(607); // Enslaved
798  break;
800  pTextColorID = 85;
801  pText =
802  localization->GetString(610); // Day of Protection
803  break;
805  pTextColorID = 86;
806  pText = localization->GetString(609); // Hour of Power
807  break;
808  case ACTOR_BUFF_SHIELD:
809  pTextColorID = 17;
810  pText = localization->GetString(279); // Shield
811  break;
813  pTextColorID = 38;
814  pText = localization->GetString(442); // Stoneskin
815  break;
816  case ACTOR_BUFF_BLESS:
817  pTextColorID = 46;
818  pText = localization->GetString(443); // Bless
819  break;
820  case ACTOR_BUFF_HEROISM:
821  pTextColorID = 51;
822  pText = localization->GetString(440); // Heroism
823  break;
824  case ACTOR_BUFF_HASTE:
825  pTextColorID = 5;
826  pText = localization->GetString(441); // Haste
827  break;
829  pTextColorID = 95;
830  pText =
831  localization->GetString(229); // Pain Reflection
832  break;
834  pTextColorID = 73;
835  pText = localization->GetString(228); // Hammerhands
836  break;
837  default:
838  pText = "";
839  break;
840  }
841  if (_stricmp(pText, "")) {
842  pWindow->DrawText(pFontSmallnum, 28, pTextHeight,
843  GetSpellColor(pTextColorID), pText, 0, 0,
844  0);
845  pTextHeight =
846  pTextHeight + *(char *)((int)pFontSmallnum + 5) - 3;
847  }
848  }
849  }
850  if (!_stricmp(pText, ""))
851  pWindow->DrawText(pFontSmallnum, 28, pTextHeight,
852  Color16(0xE1u, 255, 0x9Bu),
853  localization->GetString(153), 0, 0, 0); // Нет
854  }
855 
856  String txt2;
857  if (normal_level) {
858  auto str =
859  StringPrintf("%s\f%05u\t100%d\n", localization->GetString(108), 0,
860  pActors[uActorID].pMonsterInfo.uHP);
861  pWindow->DrawText(pFontSmallnum, 150, (int)doll_rect.y,
862  Color16(0xE1u, 255, 0x9Bu), str, 0, 0, 0);
863  pTextHeight = doll_rect.y + pFontSmallnum->GetHeight() - 3;
864  txt2 = StringPrintf("%s\f%05u\t100%d\n", localization->GetString(12), 0,
865  pActors[uActorID].pMonsterInfo.uAC); // Armor Class
866  } else {
867  auto str = StringPrintf(
868  "%s\f%05u\t100%s\n", localization->GetString(108), 0,
870  630)); //? - [630] actually displays a question mark
871  pWindow->DrawText(pFontSmallnum, 150, (int)doll_rect.y,
872  Color16(0xE1u, 255, 0x9Bu), str, 0, 0, 0);
873  pTextHeight = doll_rect.y + pFontSmallnum->GetHeight() - 3;
874  txt2 = StringPrintf(
875  "%s\f%05u\t100%s\n", localization->GetString(12), 0,
877  630)); //? - [630] actually displays a question mark
878  }
879  pWindow->DrawText(pFontSmallnum, 150, pTextHeight,
880  Color16(0xE1u, 255, 0x9Bu), txt2, 0, 0, 0);
881  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 6 +
883 
884  const char *content[11] = {0};
885  content[0] = localization->GetSpellSchoolName(0);
886  content[1] = localization->GetSpellSchoolName(1);
887  content[2] = localization->GetSpellSchoolName(2);
888  content[3] = localization->GetSpellSchoolName(3);
889  content[4] = localization->GetString(624); // Physical
890  content[5] = localization->GetString(138); // Magic
891  content[6] = localization->GetSpellSchoolName(5);
892  content[7] = localization->GetSpellSchoolName(4);
893  content[8] = localization->GetSpellSchoolName(6);
894  content[9] = localization->GetSpellSchoolName(7);
895  content[10] = localization->GetSpellSchoolName(8);
896 
897  String txt4;
898  if (expert_level) {
899  auto txt3 = StringPrintf(
900  "%s\f%05u\t080%s\n", localization->GetString(18), 0,
901  content[pActors[uActorID].pMonsterInfo.uAttack1Type]); // Attack
902  pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight,
903  Color16(0xE1u, 255, 0x9Bu), txt3, 0, 0, 0);
904 
905  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
906  if (pActors[uActorID].pMonsterInfo.uAttack1DamageBonus)
907  txt4 = StringPrintf(
908  "%s\f%05u\t080%dd%d+%d\n", localization->GetString(53), 0,
909  pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls,
910  pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides,
911  pActors[uActorID].pMonsterInfo.uAttack1DamageBonus);
912  else
913  txt4 = StringPrintf(
914  "%s\f%05u\t080%dd%d\n", localization->GetString(53), 0,
915  pActors[uActorID].pMonsterInfo.uAttack1DamageDiceRolls,
916  pActors[uActorID].pMonsterInfo.uAttack1DamageDiceSides);
917  } else {
918  auto txt3 =
919  StringPrintf("%s\f%05u\t080%s\n", localization->GetString(18), 0,
920  localization->GetString(630));
921  pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight,
922  Color16(0xE1u, 255, 0x9Bu), txt3, 0, 0, 0);
923  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
924  txt4 = StringPrintf("%s\f%05u\t080%s\n", localization->GetString(53), 0,
925  localization->GetString(630));
926  }
927  pWindow->DrawText(pFontSmallnum, 150, pTextHeight,
928  Color16(0xE1u, 255, 0x9Bu), txt4, 0, 0, 0);
929 
930  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 6 +
932  if (!master_level) {
933  auto txt5 =
934  StringPrintf("%s\f%05u\t080%s\n", localization->GetString(628), 0,
935  localization->GetString(630)); // "Spell" "?"
936  pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight,
937  Color16(0xE1u, 255, 0x9Bu), txt5, 0, 0, 0);
938  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
939  } else {
940  pText = localization->GetString(628); // Spell
941  if (pActors[uActorID].pMonsterInfo.uSpell1ID &&
942  pActors[uActorID].pMonsterInfo.uSpell2ID)
943  pText = localization->GetString(629); // Spells
944  if (pActors[uActorID].pMonsterInfo.uSpell1ID) {
945  auto txt6 = StringPrintf(
946  "%s\f%05u\t070%s\n", pText, 0,
947  pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell1ID]
948  .pShortName); // "%s\f%05u\t060%s\n"
949  pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight,
950  Color16(0xE1u, 255, 0x9Bu), txt6, 0, 0, 0);
951  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
952  }
953  if (pActors[uActorID].pMonsterInfo.uSpell2ID) {
954  auto txt6 = StringPrintf(
955  "\f%05u\t070%s\n", 0,
956  pSpellStats->pInfos[pActors[uActorID].pMonsterInfo.uSpell2ID]
957  .pShortName); // "%s\f%05u\t060%s\n"
958  pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight,
959  Color16(0xE1u, 255, 0x9Bu), txt6, 0, 0, 0);
960  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
961  }
962  if (!pActors[uActorID].pMonsterInfo.uSpell1ID &&
963  !pActors[uActorID].pMonsterInfo.uSpell2ID) {
964  auto txt6 = StringPrintf(
965  "%s\f%05u\t070%s\n", localization->GetString(628), 0,
966  localization->GetString(153)); // "%s\f%05u\t060%s\n"
967  pWindow->DrawText(pFontSmallnum, 150, (int)pTextHeight,
968  Color16(0xE1u, 255, 0x9Bu), txt6, 0, 0, 0);
969  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
970  }
971  }
972 
973  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
974  pWindow->DrawText(pFontSmallnum, 150, pTextHeight,
975  Color16(0xE1u, 255, 0x9Bu), localization->GetString(626),
976  0, 0, 0); // Immune
977  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
978 
979  const char *string_name[10] = {0};
980  string_name[0] = localization->GetSpellSchoolName(0); // Fire
981  string_name[1] = localization->GetSpellSchoolName(1); // Air
982  string_name[2] = localization->GetSpellSchoolName(2);
983  string_name[3] = localization->GetSpellSchoolName(3);
984  string_name[4] = localization->GetSpellSchoolName(4);
985  string_name[5] = localization->GetSpellSchoolName(5);
986  string_name[6] = localization->GetSpellSchoolName(6);
987  string_name[7] = localization->GetSpellSchoolName(7);
988  string_name[8] = localization->GetSpellSchoolName(8);
989  string_name[9] = localization->GetString(624); // Physical
990 
991  unsigned char resistances[11] = {0};
992  resistances[0] = pActors[uActorID].pMonsterInfo.uResFire;
993  resistances[1] = pActors[uActorID].pMonsterInfo.uResAir;
994  resistances[2] = pActors[uActorID].pMonsterInfo.uResWater;
995  resistances[3] = pActors[uActorID].pMonsterInfo.uResEarth;
996  resistances[4] = pActors[uActorID].pMonsterInfo.uResMind;
997  resistances[5] = pActors[uActorID].pMonsterInfo.uResSpirit;
998  resistances[6] = pActors[uActorID].pMonsterInfo.uResBody;
999  resistances[7] = pActors[uActorID].pMonsterInfo.uResLight;
1000  resistances[8] = pActors[uActorID].pMonsterInfo.uResPhysical;
1001  resistances[9] = pActors[uActorID].pMonsterInfo.uResDark;
1002 
1003  if (grandmaster_level) {
1004  for (uint i = 0; i < 10; i++) {
1005  if (resistances[i] == 200) {
1006  pText = localization->GetString(625); // Immune
1007  } else {
1008  if (resistances[i])
1009  pText = localization->GetString(627); // Resistant
1010  else
1011  pText = localization->GetString(153); // None
1012  }
1013 
1014  auto txt7 =
1015  StringPrintf("%s\f%05u\t070%s\n", string_name[i], 0, pText);
1016  pWindow->DrawText(pFontSmallnum, 170, pTextHeight,
1017  Color16(0xE1u, 255, 0x9Bu), txt7, 0, 0, 0);
1018  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
1019  }
1020  } else {
1021  for (uint i = 0; i < 10; ++i) {
1022  auto txt8 = StringPrintf("%s\f%05u\t070%s\n", string_name[i], 0,
1023  localization->GetString(630)); // "?"
1024  pWindow->DrawText(pFontSmallnum, 170, pTextHeight,
1025  Color16(0xE1u, 255, 0x9Bu), txt8, 0, 0, 0);
1026  pTextHeight = pTextHeight + pFontSmallnum->GetHeight() - 3;
1027  }
1028  }
1029 
1030  // cast spell: Detect life
1031  if (pParty->pPartyBuffs[PARTY_BUFF_DETECT_LIFE].Active()) {
1032  auto txt9 =
1033  StringPrintf("%s: %d", localization->GetString(650),
1034  pActors[uActorID].sCurrentHP); // Current Hit Points
1035  pFontSmallnum->GetLineWidth(txt9);
1036  pWindow->DrawTitleText(
1037  pFontSmallnum, 0,
1038  pWindow->uFrameHeight - pFontSmallnum->GetHeight() - 12, 0, txt9,
1039  3);
1040  }
1041 }
1042 
1043 //----- (00417BB5) --------------------------------------------------------
1044 String CharacterUI_GetSkillDescText(unsigned int uPlayerID,
1045  PLAYER_SKILL_TYPE uPlayerSkillType) {
1046  char a2[1200]; // [sp+Ch] [bp-538h]@7
1047  char Source[120]; // [sp+4BCh] [bp-88h]@7
1048  int v35; // [sp+53Ch] [bp-8h]@1
1049 
1050  v35 = pFontSmallnum->GetLineWidth(localization->GetString(431)); // Normal
1052  (signed int)v35)
1053  v35 = pFontSmallnum->GetLineWidth(
1054  localization->GetString(433)); // Expert
1056  (signed int)v35)
1057  v35 = pFontSmallnum->GetLineWidth(
1058  localization->GetString(432)); // Master
1060  (signed int)v35)
1061  v35 =
1063 
1064  char static_sub_417BB5_out_string[1200];
1065  a2[0] = 0;
1066  Source[0] = 0;
1067  strcpy(a2, "%s\n\n");
1068  sprintf(Source, "\f%05d",
1069  GetSkillColor(pParty->pPlayers[uPlayerID].classType,
1070  uPlayerSkillType, 1));
1071  strcat(a2, Source);
1072  strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1073  sprintf(Source, "\f%05d",
1074  GetSkillColor(pParty->pPlayers[uPlayerID].classType,
1075  uPlayerSkillType, 2));
1076  strcat(a2, Source);
1077  strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1078  sprintf(Source, "\f%05d",
1079  GetSkillColor(pParty->pPlayers[uPlayerID].classType,
1080  uPlayerSkillType, 3));
1081  strcat(a2, Source);
1082  strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1083  sprintf(Source, "\f%05d",
1084  GetSkillColor(pParty->pPlayers[uPlayerID].classType,
1085  uPlayerSkillType, 4));
1086  strcat(a2, Source);
1087  strcat(a2, "%s\t%03d:\t%03d%s\t000\n");
1088  if ((pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] & 0x3F) ==
1089  (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) &
1090  0x3F)) {
1091  sprintf(static_sub_417BB5_out_string, a2,
1092  localization->GetSkillDescription(uPlayerSkillType),
1093  localization->GetString(431), v35 + 3, v35 + 15,
1095  uPlayerSkillType), // changed from 5 to 15 to add space
1096  // after ':'
1097  localization->GetString(433), v35 + 3, v35 + 15,
1098  localization->GetSkillDescriptionExpert(uPlayerSkillType),
1099  localization->GetString(432), v35 + 3, v35 + 15,
1100  localization->GetSkillDescriptionMaster(uPlayerSkillType),
1101  localization->GetString(96), v35 + 3, v35 + 15,
1102  localization->GetSkillDescriptionGrand(uPlayerSkillType));
1103  } else {
1104  sprintf(Source, "\f%05d", Color16(0xFFu, 0xFFu, 0xFFu));
1105  strcat(a2, Source);
1106  strcat(a2, "%s: +%d");
1107  sprintf(
1108  static_sub_417BB5_out_string, a2,
1109  localization->GetSkillDescription(uPlayerSkillType),
1110  localization->GetString(431), v35 + 3, v35 + 5,
1111  localization->GetSkillDescriptionNormal(uPlayerSkillType),
1112  localization->GetString(433), v35 + 3, v35 + 5,
1113  localization->GetSkillDescriptionExpert(uPlayerSkillType),
1114  localization->GetString(432), v35 + 3, v35 + 5,
1115  localization->GetSkillDescriptionMaster(uPlayerSkillType),
1116  localization->GetString(96), v35 + 3, v35 + 5,
1117  localization->GetSkillDescriptionGrand(uPlayerSkillType),
1118  localization->GetString(623), // Bonus
1119  (pParty->pPlayers[uPlayerID].GetActualSkillLevel(uPlayerSkillType) &
1120  0x3F) -
1121  (pParty->pPlayers[uPlayerID].pActiveSkills[uPlayerSkillType] &
1122  0x3F));
1123  }
1124  return String(static_sub_417BB5_out_string);
1125 }
1126 
1128  unsigned int pX = 0;
1129  unsigned int pY = 0;
1130  pMouse->GetClickPos(&pX, &pY);
1131 
1132  if (pX < 24 || pX > 455 || pY < 18 || pY > 36) {
1133  for (GUIButton *pButton : pGUIWindow_CurrentMenu->vButtons) {
1134  if (pButton->msg == UIMSG_SkillUp && pX >= pButton->uX &&
1135  pX <= pButton->uZ && pY >= pButton->uY && pY <= pButton->uW) {
1136  String pSkillDescText = CharacterUI_GetSkillDescText(
1137  uActiveCharacter - 1,
1138  (PLAYER_SKILL_TYPE)pButton->msg_param);
1140  localization->GetSkillName(pButton->msg_param),
1141  pSkillDescText);
1142  }
1143  }
1144  } else {
1146  localization->GetString(207),
1147  pSkillPointsAttributeDescription); // Skill points / Очки
1148  // навыков
1149  }
1150 }
1151 
1152 //----- (00418083) --------------------------------------------------------
1154  int pStringNum; // edi@1
1155  signed int pTextColor; // eax@15
1156  const char *pHourWord; // ecx@17
1157  const char *pDayWord; // eax@20
1158  int v15; // ebx@28
1159  int pHour; // [sp+14h] [bp-1Ch]@15
1160  unsigned int pDay; // [sp+24h] [bp-Ch]@15
1161 
1162  Point pt = pMouse->GetCursorPos();
1163  for (pStringNum = 0; pStringNum < stat_string_coord.size(); ++pStringNum) {
1164  if (pt.x >= stat_string_coord[pStringNum].x &&
1165  pt.x <= stat_string_coord[pStringNum].x +
1166  stat_string_coord[pStringNum].width) {
1167  if (pt.y >= stat_string_coord[pStringNum].y &&
1168  pt.y <= stat_string_coord[pStringNum].y +
1169  stat_string_coord[pStringNum].height)
1170  break;
1171  }
1172  }
1173 
1174  switch (pStringNum) {
1175  case 0: // Attributes
1176  case 1:
1177  case 2:
1178  case 3:
1179  case 4:
1180  case 5:
1181  case 6:
1183  localization->GetAttirubteName(pStringNum),
1184  localization->GetAttributeDescription(pStringNum));
1185  break;
1186  case 7: // Health Points
1190  break;
1191  case 8: // Spell Points
1195  break;
1196  case 9: // Armor Class
1200  break;
1201  case 10: // Player Condition
1202  {
1203  auto str = String(pPlayerConditionAttributeDescription) + "\n";
1204 
1205  extern std::array<unsigned int, 18> pConditionImportancyTable;
1206  for (uint i = 0; i < 18; ++i) {
1208  ->conditions_times[pConditionImportancyTable[i]]
1209  .Valid()) {
1210  str += " \n";
1211  auto condition_time =
1212  pParty->GetPlayingTime() -
1214  ->conditions_times[pConditionImportancyTable[i]];
1215  pHour = condition_time.GetHoursOfDay();
1216  pDay = condition_time.GetDays();
1217  pTextColor =
1219  str += StringPrintf(format_4E2DE8, pTextColor,
1222  if (pHour && pHour <= 1)
1223  pHourWord = localization->GetString(109);
1224  else
1225  pHourWord = localization->GetString(110);
1226  if (!pDay ||
1227  (pDayWord = localization->GetString(56), pDay > 1))
1228  pDayWord = localization->GetString(57);
1229  str += StringPrintf("%lu %s, %lu %s", pDay, pDayWord, pHour,
1230  pHourWord);
1231  }
1232  }
1233 
1234  if (!str.empty())
1236  break;
1237  }
1238 
1239  case 11: // Fast Spell
1243  break;
1244 
1245  case 12: // Player Age
1249  break;
1250 
1251  case 13: // Player Level
1255  break;
1256 
1257  case 14: // Experience
1258  {
1259  v15 = pPlayers[uActiveCharacter]->uLevel;
1260  do {
1261  if (pPlayers[uActiveCharacter]->uExperience < GetExperienceRequiredForLevel(v15))
1262  break;
1263  ++v15;
1264  } while (v15 <= 10000);
1265 
1266  String str1;
1267  String str2;
1268  if (v15 > pPlayers[uActiveCharacter]->uLevel)
1269  str1 = localization->FormatString(LSTR_ELIGIBLE_TO_LEVELUP, v15);
1270  str2 = localization->FormatString(
1271  LSTR_XP_UNTIL_NEXT_LEVEL,
1272  (int)(GetExperienceRequiredForLevel(v15) - pPlayers[uActiveCharacter]->uExperience),
1273  v15 + 1);
1274  str1 += "\n" + str2;
1275 
1276  str2 = String(pPlayerExperienceAttributeDescription) + "\n \n" + str1;
1277 
1279  break;
1280  }
1281 
1282  case 15: // Attack Bonus
1284  int meleerecov = pPlayers[uActiveCharacter]->GetAttackRecoveryTime(0);
1285  char recov[100];
1286  sprintf(recov, "\n\nRecovery time: %d", meleerecov);
1289  /*pAttackBonusAttributeDescription*/test);
1290  }
1291  break;
1292 
1293  case 16: // Attack Damage
1297  break;
1298 
1299  case 17: // Missle Bonus
1301  int missrecov = pPlayers[uActiveCharacter]->GetAttackRecoveryTime(1);
1302  char recovm[100];
1303  sprintf(recovm, "\n\nRecovery time: %d", missrecov);
1306  /*pMissleBonusAttributeDescription*/test2);
1307  }
1308  break;
1309 
1310  case 18: // Missle Damage
1314  break;
1315 
1316  case 19: // Fire Resistance
1320  break;
1321 
1322  case 20: // Air Resistance
1326  break;
1327 
1328  case 21: // Water Resistance
1332  break;
1333 
1334  case 22: // Earth Resistance
1338  break;
1339 
1340  case 23: // Mind Resistance
1344  break;
1345 
1346  case 24: // Body Resistance
1350  break;
1351 
1352  case 25: // Skill Points
1356  break;
1357 
1358  case 26: // Class description
1359  {
1361  pPlayers[uActiveCharacter]->classType),
1363  pPlayers[uActiveCharacter]->classType));
1364  } break;
1365 
1366  default:
1367  break;
1368  }
1369 }
1370 
1371 //----- (00410B28) --------------------------------------------------------
1372 void DrawSpellDescriptionPopup(int spell_index) {
1373  SpellInfo *spell; // esi@1
1374  unsigned int v3; // eax@2
1375  long v5; // ecx@4
1376  GUIWindow spell_info_window; // [sp+Ch] [bp-68h]@4
1377 
1378  Point pt = pMouse->GetCursorPos();
1379 
1380  spell =
1381  &pSpellStats
1382  ->pInfos[spell_index +
1383  11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage +
1384  1];
1385  if (pt.y <= 250)
1386  v3 = pt.y + 30;
1387  else
1388  v3 = 30;
1389  spell_info_window.uFrameY = v3;
1390  spell_info_window.uFrameWidth = 328;
1391  spell_info_window.uFrameHeight = 68;
1392  spell_info_window.uFrameX = 90;
1393  spell_info_window.uFrameZ = 417;
1394  spell_info_window.uFrameW = v3 + 67;
1395  spell_info_window.sHint.clear();
1396  v5 = pFontSmallnum->GetLineWidth(localization->GetString(431)); // Normal
1398  v5) // Master
1400  localization->GetString(432)); // Master
1402  v5) // Expert
1404  localization->GetString(433)); // Expert
1405  if (pFontSmallnum->GetLineWidth(localization->GetString(96)) > v5) // Grand
1407 
1408  String str = StringPrintf(
1409  "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%"
1410  "s\t000\n%s\t%03d:\t%03d%s",
1411  spell->pDescription, localization->GetString(431), v5 + 3, v5 + 10,
1412  spell->pBasicSkillDesc, // Normal
1413  localization->GetString(433), v5 + 3, v5 + 10,
1414  spell->pExpertSkillDesc, // Expert
1415  localization->GetString(432), v5 + 3, v5 + 10,
1416  spell->pMasterSkillDesc, // Master
1417  localization->GetString(96), v5 + 3, v5 + 10,
1418  spell->pGrandmasterSkillDesc); // Grand
1419  spell_info_window.uFrameHeight +=
1420  pFontSmallnum->CalcTextHeight(str, spell_info_window.uFrameWidth, 0);
1421  if ((signed int)spell_info_window.uFrameHeight < 150)
1422  spell_info_window.uFrameHeight = 150;
1423  spell_info_window.uFrameWidth = game_viewport_width;
1424  spell_info_window.DrawMessageBox(0);
1425  spell_info_window.uFrameWidth -= 12;
1426  spell_info_window.uFrameHeight -= 12;
1427  spell_info_window.uFrameZ =
1428  spell_info_window.uFrameX + spell_info_window.uFrameWidth - 1;
1429  spell_info_window.uFrameW =
1430  spell_info_window.uFrameHeight + spell_info_window.uFrameY - 1;
1431  spell_info_window.DrawTitleText(
1432  pFontArrus, 0x78u, 0xCu, Color16(0xFFu, 0xFFu, 0x9Bu), spell->pName, 3);
1433  spell_info_window.DrawText(pFontSmallnum, 120, 44, 0, str, 0, 0, 0);
1434  spell_info_window.uFrameWidth = 108;
1435  spell_info_window.uFrameZ = spell_info_window.uFrameX + 107;
1436  int skill_level = SkillToMastery(
1437  pPlayers[uActiveCharacter]->pActiveSkills
1438  [pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12]);
1439  spell_info_window.DrawTitleText(
1440  pFontComic, 12, 75, 0,
1442  pPlayers[uActiveCharacter]->lastOpenedSpellbookPage + 12),
1443  3);
1444 
1445  auto str2 = StringPrintf(
1446  "%s\n%d", localization->GetString(522), // SP Cost
1447  pSpellDatas[spell_index +
1448  11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage +
1449  1]
1450  .mana_per_skill[skill_level - 1]);
1451  spell_info_window.DrawTitleText(
1452  pFontComic, 12,
1453  spell_info_window.uFrameHeight - pFontComic->GetHeight() - 16, 0, str2,
1454  3);
1456 }
1457 
1458 //----- (00416D62) --------------------------------------------------------
1459 void UI_OnMouseRightClick(int mouse_x, int mouse_y) {
1460  int v5; // esi@62
1461  // GUIButton *pButton; // esi@84
1462  const char *pStr; // edi@85
1463  // const char *pHint; // edx@113
1464  GUIWindow popup_window; // [sp+4h] [bp-74h]@32
1465 
1467  return;
1468 
1469 
1470  unsigned int pX = mouse_x;
1471  unsigned int pY = mouse_y;
1472 
1473  // if ( render->bWindowMode )
1474  {
1475  Point pt = Point(pX, pY);
1476  if (pt.x < 1 || pt.y < 1 || pt.x > 638 || pt.y > 478) {
1477  back_to_game();
1478  return;
1479  }
1480  }
1481  if (pParty->pPickedItem.uItemID) { // нажатие на портрет перса правой кнопкой
1482  // мыши с раствором
1483  for (uint i = 0; i < 4; ++i) {
1484  if ((signed int)pX > RightClickPortraitXmin[i] &&
1485  (signed int)pX < RightClickPortraitXmax[i] &&
1486  (signed int)pY > 375 && (signed int)pY < 466) {
1487  pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(i + 1, 1);
1488  return;
1489  }
1490  }
1491  }
1492 
1493  pEventTimer->Pause();
1494  switch (current_screen_type) {
1497  break;
1498  }
1500  if (!pPlayers[uActiveCharacter]->CanAct()) {
1501  static String hint_reference;
1502  hint_reference = localization->FormatString(
1503  427, pPlayers[uActiveCharacter]->pName,
1505  541)); // %s не в состоянии %s Опознать предметы
1506 
1507  popup_window.sHint = hint_reference;
1508  popup_window.uFrameWidth = 384;
1509  popup_window.uFrameHeight = 180;
1510  popup_window.uFrameY = 40;
1511  if ((signed int)pX <= 320)
1512  popup_window.uFrameX = pX + 30;
1513  else
1514  popup_window.uFrameX = pX - 414;
1515  popup_window.DrawMessageBox(0);
1516  } else {
1517  // this could be put into a chest function
1518 
1519  int chestheight =
1520  9; // pChestHeightsByType[pChests[(int)pGUIWindow_CurrentMenu->par1C].uChestBitmapID];
1521  int chestwidth = 9;
1522  int inventoryYCoord = (pY - 34) / 32; // use pchestoffsets??
1523  int inventoryXCoord = (pX - 42) / 32;
1524  int invMatrixIndex =
1525  inventoryXCoord + (chestheight * inventoryYCoord);
1526 
1527  if (inventoryYCoord >= 0 && inventoryYCoord < chestheight &&
1528  inventoryXCoord >= 0 && inventoryXCoord < chestwidth) {
1529  int chestindex = vChests[(int)pGUIWindow_CurrentMenu->par1C].pInventoryIndices[invMatrixIndex];
1530  if (chestindex < 0) {
1531  invMatrixIndex = (-(chestindex + 1));
1532  chestindex = vChests[(int)pGUIWindow_CurrentMenu->par1C].pInventoryIndices[invMatrixIndex];
1533  }
1534 
1535  if (chestindex) {
1536  int itemindex = chestindex - 1;
1537 
1538  GameUI_DrawItemInfo(&vChests[pChestWindow->par1C].igChestItems[itemindex]);
1539  }
1540  }
1541  }
1542  break;
1543  }
1544 
1545  case CURRENT_SCREEN::SCREEN_GAME: // In the main menu displays a pop-up window(В
1546  // главном меню показывает всплывающее окно)
1547  {
1548  if (GetCurrentMenuID() > 0) break;
1549  if ((signed int)pY > (signed int)pViewport->uViewportBR_Y) {
1550  popup_window.ptr_1C = (void *)((signed int)pX / 118);
1551  if ((signed int)pX / 118 < 4) { // portaits zone
1552  popup_window.sHint.clear();
1553  popup_window.uFrameWidth = 400;
1554  popup_window.uFrameHeight = 200;
1555  popup_window.uFrameX = 38;
1556  popup_window.uFrameY = 60;
1557  pAudioPlayer->StopChannels(-1, -1);
1559  &popup_window, pPlayers[(int)popup_window.ptr_1C + 1]);
1560  }
1561  } else if ((int)pX > pViewport->uViewportBR_X) {
1562  if (pY >= 130) {
1563  if (pX >= 476 && pX <= 636 && pY >= 240 && pY <= 300) { // buff_tooltip zone
1564  popup_window.sHint.clear();
1565  popup_window.uFrameWidth = 400;
1566  popup_window.uFrameHeight = 200;
1567  popup_window.uFrameX = 38;
1568  popup_window.uFrameY = 60;
1569  pAudioPlayer->StopChannels(-1, -1);
1570  popup_window._41D73D_draw_buff_tooltip();
1571  } else if ((int)pX < 485 || (int)pX > 548 ||
1572  (int)pY < 156 ||
1573  (int)pY > 229) { // NPC zone
1574  if (!((signed int)pX < 566 || (signed int)pX > 629 ||
1575  (signed int)pY < 156 || (signed int)pY > 229)) {
1576  pAudioPlayer->StopChannels(-1, -1);
1577  GameUI_DrawNPCPopup((void *)1); // NPC 2
1578  }
1579  } else {
1580  pAudioPlayer->StopChannels(-1, -1);
1581  GameUI_DrawNPCPopup(0); // NPC 1
1582  }
1583  } else { // minimap zone
1584  popup_window.sHint = GameUI_GetMinimapHintText();
1585  popup_window.uFrameWidth = 256;
1586  popup_window.uFrameX = 130;
1587  popup_window.uFrameY = 140;
1588  popup_window.uFrameHeight = 64;
1589  pAudioPlayer->StopChannels(-1, -1);
1590  popup_window.DrawMessageBox(0);
1591  }
1592  } else { // game zone
1593  popup_window.sHint.clear();
1594  popup_window.uFrameWidth = 320;
1595  popup_window.uFrameHeight = 320;
1596  popup_window.uFrameX = pX - 350;
1597  if ((signed int)pX <= 320) popup_window.uFrameX = pX + 30;
1598  popup_window.uFrameY = 40;
1599  // if ( render->pRenderD3D )
1600 
1601  auto vis = EngineIoc::ResolveVis();
1602  v5 = vis->get_picked_object_zbuf_val();
1603  /*else
1604  v5 = render->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];*/
1605  if (PID_TYPE(v5) == OBJECT_Actor) {
1606  render->BeginScene();
1607  popup_window.DrawMessageBox(1);
1608  MonsterPopup_Draw(PID_ID(v5), &popup_window);
1609  render->EndScene();
1610  }
1611  if (PID_TYPE(v5) == OBJECT_Item) {
1612  if (!(pObjectList
1613  ->pObjects[pSpriteObjects[PID_ID((unsigned __int16)v5)].uObjectDescID].uFlags & 0x10)) {
1615  &pSpriteObjects[PID_ID((unsigned __int16)v5)].containing_item);
1616  }
1617  }
1618  }
1619  break;
1620  }
1622  if (!MapBookOpen ||
1623  (signed int)pX < (signed int)pViewport->uViewportTL_X ||
1624  (signed int)pX > (signed int)pViewport->uViewportBR_X ||
1625  (signed int)pY < (signed int)pViewport->uViewportTL_Y ||
1626  (signed int)pY > (signed int)pViewport->uViewportBR_Y ||
1627  ((popup_window.sHint = GetMapBookHintText(mouse_x, mouse_y)).empty()))
1628  break;
1629  popup_window.uFrameWidth =
1630  (pFontArrus->GetLineWidth(popup_window.sHint) + 32) + 0.5f;
1631  popup_window.uFrameX = pX + 5;
1632  popup_window.uFrameY = pY + 5;
1633  popup_window.uFrameHeight = 64;
1634  pAudioPlayer->StopChannels(-1, -1);
1635  popup_window.DrawMessageBox(0);
1636  break;
1637  }
1641  if ((signed int)pX > 467 && current_screen_type != CURRENT_SCREEN::SCREEN_E)
1643  else if ((signed int)pY >= 345)
1644  break;
1646  WINDOW_CharacterWindow_Stats) // 2DEvent -
1647  // CharacerScreenStats
1650  WINDOW_CharacterWindow_Skills) // 2DEvent -
1651  // CharacerScreenSkills
1653  else if (
1655  WINDOW_CharacterWindow_Inventory) // 2DEvent -
1656  // CharacerScreenInventory
1658  break;
1659  }
1664  break;
1665  }
1667  if ((signed int)pY < 345 && (signed int)pX < 469)
1669  break;
1670  }
1672  popup_window.sHint.clear();
1673  pStr = 0;
1674  for (GUIButton *pButton : pGUIWindow_CurrentMenu->vButtons) {
1675  if (pButton->uButtonType == 1 && pButton->uButtonType != 3 &&
1676  (signed int)pX > (signed int)pButton->uX &&
1677  (signed int)pX < (signed int)pButton->uZ &&
1678  (signed int)pY > (signed int)pButton->uY &&
1679  (signed int)pY < (signed int)pButton->uW) {
1680  switch (pButton->msg) {
1681  case UIMSG_0: // stats info
1682  popup_window.sHint =
1684  (int)pButton->msg_param % 7);
1686  (int)pButton->msg_param % 7);
1687  break;
1688  case UIMSG_PlayerCreationClickPlus: // Plus button info
1689  pStr = localization->GetString(670); //Добавить
1690  popup_window.sHint = localization->GetString(
1691  671); //"Добавляет очко к выделенному навыку,
1692  //забирая его из накопителя очков"
1693  break;
1694  case UIMSG_PlayerCreationClickMinus: // Minus button
1695  // info
1696  pStr = localization->GetString(668); //Вычесть
1697  popup_window.sHint = localization->GetString(
1698  669); //"Вычитает очко из выделенного навыка,
1699  //возвращая его в накопитель очков"
1700  break;
1701  case UIMSG_PlayerCreationSelectActiveSkill: // Available
1702  // skill
1703  // button
1704  // info
1705  pStr = localization->GetSkillName(
1706  pParty
1707  ->pPlayers
1709  .GetSkillIdxByOrder(pButton->msg_param +
1710  4));
1711  popup_window
1713  pParty
1714  ->pPlayers
1716  .GetSkillIdxByOrder(pButton->msg_param +
1717  4));
1718  break;
1719  case UIMSG_PlayerCreationSelectClass: // Available
1720  // Class Info
1721  popup_window.sHint =
1723  pButton->msg_param);
1724  pStr =
1725  localization->GetClassName(pButton->msg_param);
1726  break;
1727  case UIMSG_PlayerCreationClickOK: // OK Info
1728  popup_window.sHint = localization->GetString(
1729  664); //Щелкните здесь для утверждения состава
1730  //отряда и продолжения игры.
1731  pStr = localization->GetString(665); //Кнопка ОК
1732  break;
1733  case UIMSG_PlayerCreationClickReset: // Clear info
1734  popup_window.sHint = localization->GetString(
1735  666); //Сбрасывает все параметры и навыки
1736  //отряда.
1737  pStr =
1738  localization->GetString(667); //Кнопка Очистить
1739  break;
1740  case UIMSG_PlayerCreation_SelectAttribute: // Character
1741  // info
1742  pStr = pParty->pPlayers[pButton->msg_param].pName;
1743  popup_window
1745  pParty->pPlayers[pButton->msg_param].classType);
1746  break;
1747  }
1748  if (pButton->msg > UIMSG_44 &&
1749  pButton->msg <=
1750  UIMSG_PlayerCreationRemoveDownSkill) { // Sellected
1751  // skills info
1752  pY = 0;
1753  if ((int)pParty->pPlayers[pButton->msg_param]
1754  .GetSkillIdxByOrder(pButton->msg - UIMSG_48) <
1755  37) {
1756  static String hint_reference;
1757  hint_reference = CharacterUI_GetSkillDescText(
1758  pButton->msg_param,
1760  ->pPlayers[pButton->msg_param]
1761  .GetSkillIdxByOrder(pButton->msg -
1762  UIMSG_48));
1763 
1764  popup_window.sHint = hint_reference;
1765  pStr = localization->GetSkillName(
1766  pParty->pPlayers[pButton->msg_param]
1767  .GetSkillIdxByOrder(pButton->msg -
1768  UIMSG_48));
1769  }
1770  }
1771  }
1772  }
1773  if (!popup_window.sHint.empty()) {
1774  String sHint = popup_window.sHint;
1775  popup_window.sHint.clear();
1776  popup_window.uFrameWidth = 384;
1777  popup_window.uFrameHeight = 256;
1778  popup_window.uFrameX = 128;
1779  popup_window.uFrameY = 40;
1780  popup_window.uFrameHeight =
1782  sHint, popup_window.uFrameWidth, 24) +
1783  2 * pFontLucida->GetHeight() + 24;
1784  popup_window.uFrameZ =
1785  popup_window.uFrameX + popup_window.uFrameWidth - 1;
1786  popup_window.uFrameW =
1787  popup_window.uFrameY + popup_window.uFrameHeight - 1;
1788  popup_window.DrawMessageBox(0);
1789  popup_window.uFrameX += 12;
1790  popup_window.uFrameWidth -= 24;
1791  popup_window.uFrameY += 12;
1792  popup_window.uFrameHeight -= 12;
1793  popup_window.uFrameZ =
1794  popup_window.uFrameX + popup_window.uFrameWidth - 1;
1795  popup_window.uFrameW =
1796  popup_window.uFrameY + popup_window.uFrameHeight - 1;
1797 
1798  auto str = StringPrintf("\f%05d%s\f00000\n",
1799  Color16(0xFF, 0xFF, 0x9B), pStr);
1800  popup_window.DrawTitleText(pFontCreate, 0, 0, 0, str.c_str(),
1801  3);
1802  popup_window.DrawText(pFontSmallnum, 1,
1803  pFontLucida->GetHeight(), 0, sHint, 0, 0,
1804  0);
1805  }
1806  break;
1807  }
1808  default:
1809  break;
1810  }
1813 }
1814 
1815 int no_rightlick_in_inventory = false; // 0050CDCC
1816 //----- (00416196) --------------------------------------------------------
1817 void Inventory_ItemPopupAndAlchemy() { // needs cleaning
1818  int potion1_id; // edx@25
1819  unsigned int potion2_id; // edi@25
1820  signed int potionID; // edx@27
1821  // unsigned int pOut_y; // edx@57
1822  double v31; // st7@112
1823  Vec3_int_ v39; // [sp-18h] [bp-A8h]@83
1824  GUIWindow message_window; // [sp+Ch] [bp-84h]@137
1825  unsigned int damage_level; // [sp+8Ch] [bp-4h]@23
1826 
1827  if (no_rightlick_in_inventory) return;
1828 
1829  signed int inventoryXCoord; // ecx@2
1830  int inventoryYCoord; // eax@2
1831 
1832  unsigned int pY; // [sp+3Ch] [bp-Ch]@2
1833  unsigned int pX;
1834  // Point cursor = pMouse->GetCursorPos();
1835 
1836  ItemGen *item = nullptr;
1837 
1838  int mousex = pMouse->uMouseClickX; // condense
1839  int mousey = pMouse->uMouseClickY; // condense
1840 
1841  static int RingsX[6] = {0x1EA, 0x21A, 0x248, 0x1EA, 0x21A, 0x248};
1842  static int RingsY[6] = {0x0CA, 0x0CA, 0x0CA, 0x0FA, 0x0FA, 0x0FA};
1843 
1844  static int glovex = 586;
1845  static int glovey = 88;
1846 
1847  static int amuletx = 493;
1848  static int amulety = 91;
1849 
1850  int slot = 32;
1851  int pos = -1;
1852 
1853  pMouse->GetClickPos(&pX, &pY);
1854  inventoryYCoord = (pY - 17) / 32;
1855  inventoryXCoord = (pX - 14) / 32;
1856  int invMatrixIndex =
1857  inventoryXCoord + (14 * inventoryYCoord); // INVETORYSLOTSWIDTH
1858 
1859  if (pX <= 13 || pX >= 462) { // items out of inventory(вещи вне инвентаря)
1860  // this is for player ragdoll items??
1861  // popup checks if ringscreen up here
1862 
1863  if (!ringscreenactive()) { // rings not displayd
1864  int item_pid =
1865  (render->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]] &
1866  0xFFFF) -
1867  1;
1868  // zbuffer still used for paperdolls
1869 
1870  if (item_pid == -1) return;
1871 
1872  item = &pPlayers[uActiveCharacter]->pInventoryItemList[item_pid];
1873  GameUI_DrawItemInfo(item);
1874  return;
1875  } else { // rings displayed
1876  if (mousex < 490 || mousex > 618) return;
1877 
1878  if (mousey < 88 || mousey > 282) return;
1879 
1880  if (mousex >= amuletx && mousex <= (amuletx + slot) &&
1881  mousey >= amulety && mousey <= (amulety + 2 * slot)) {
1882  // amulet
1883  // pitem = pPlayers[uActiveCharacter]->GetAmuletItem(); //9
1884  pos = 9;
1885  }
1886 
1887  if (mousex >= glovex && mousex <= (glovex + slot) &&
1888  mousey >= glovey && mousey <= (glovey + 2 * slot)) {
1889  // glove
1890  // pitem = pPlayers[uActiveCharacter]->GetGloveItem(); //7
1891  pos = 7;
1892  }
1893 
1894  for (int i = 0; i < 6; ++i) {
1895  if (mousex >= RingsX[i] && mousex <= (RingsX[i] + slot) &&
1896  mousey >= RingsY[i] && mousey <= (RingsY[i] + slot)) {
1897  // ring
1898  // pitem = pPlayers[uActiveCharacter]->GetNthRingItem(i);
1899  // //10+i
1900  pos = 10 + i;
1901  }
1902  }
1903 
1904  if (pos != -1)
1905  item = pPlayers[uActiveCharacter]->GetNthEquippedIndexItem(pos);
1906 
1907  if (!item) return;
1908 
1909  GameUI_DrawItemInfo(item);
1910 
1911  return;
1912  }
1913  }
1914 
1915  // limits check ?
1916  // if (inventoryYCoord >= 0 && inventoryYCoord < INVETORYSLOTSHEIGHT &&
1917  // inventoryXCoord >= 0 && inventoryXCoord < INVETORYSLOTSWIDTH) {
1918 
1919  item = pPlayers[uActiveCharacter]->GetItemAtInventoryIndex(invMatrixIndex);
1920 
1921  if (!item) { // no item
1922  return;
1923  }
1924 
1925  // if (item_pid == -1) //added here to avoid crash
1926  // return;
1927 
1928  // check character condition(проверка состояния персонажа)
1929  if (!pPlayers[uActiveCharacter]->CanAct()) {
1930  static String hint_reference;
1931  hint_reference = localization->FormatString(
1932  427, pPlayers[uActiveCharacter]->pName,
1934  541)); // %s не в состоянии %s Опознать предметы
1935 
1936  message_window.sHint = hint_reference;
1937  message_window.uFrameWidth = 384;
1938  message_window.uFrameHeight = 180;
1939  if (pX <= 320)
1940  message_window.uFrameX = pX + 30;
1941  else
1942  message_window.uFrameX = pX - 414;
1943  message_window.uFrameY = 40;
1944  message_window.DrawMessageBox(0);
1945  return;
1946  }
1947 
1948  int alchemy_skill_points =
1949  pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ALCHEMY);
1950  int alchemy_skill_level =
1951  pPlayers[uActiveCharacter]->GetActualSkillMastery(PLAYER_SKILL_ALCHEMY);
1952 
1953  // for potion bottle(простая бутылка)
1955  GameUI_DrawItemInfo(item);
1956  return;
1957  }
1958 
1959  // for recharge potion(зелье перезарядка)
1961  if (item->uItemID < ITEM_POTION_BOTTLE ||
1962  item->uItemID > ITEM_POTION_REJUVENATION) { // all potions
1963  if (item->GetItemEquipType() !=
1964  EQUIP_WAND) { // can recharge only wands
1965  pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0);
1966  return;
1967  }
1968 
1969  v31 = (70.0 - (double)pParty->pPickedItem.uEnchantmentType) * 0.01;
1970  if (v31 < 0.0) v31 = 0.0;
1971  item->uMaxCharges =
1972  (signed __int64)((double)item->uMaxCharges -
1973  v31 * (double)item->uMaxCharges);
1974  item->uNumCharges =
1975  (signed __int64)((double)item->uMaxCharges -
1976  v31 * (double)item->uMaxCharges);
1977 
1980  return;
1981  }
1982  GameUI_DrawItemInfo(item);
1983  return;
1985  // for harden potion(зелье закалка)
1986  if (item->uItemID < ITEM_POTION_BOTTLE ||
1987  item->uItemID > ITEM_POTION_REJUVENATION) { // bottle and all potions
1988  if (item->IsBroken() || // cant harden broken items
1989  item->uItemID >= ITEM_ARTIFACT_PUCK || // cant harden artifacts
1991  item->GetItemEquipType() > EQUIP_WAND) {
1994  return;
1995  }
1996 
1998 
2002  return;
2003  }
2004  GameUI_DrawItemInfo(item);
2005  return;
2007  // several potions(несколько зелий)
2010  if (item->uItemID < ITEM_POTION_BOTTLE ||
2011  item->uItemID > ITEM_POTION_REJUVENATION) { // all potions
2012  if (item->uItemID >= ITEM_BLASTER &&
2013  item->uItemID <= ITEM_LASER_RIFLE ||
2014  item->uItemID >= ITEM_ARTIFACT_PUCK || item->IsBroken() ||
2015  item->special_enchantment || item->uEnchantmentType ||
2016  item->GetItemEquipType() >=
2017  EQUIP_ARMOUR) { // only melee weapons and bows
2020  return;
2021  }
2022 
2025  item->special_enchantment = ITEM_ENCHANTMENT_40; // of Slaying
2026  v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType);
2027  } else {
2028  static ITEM_ENCHANTMENT _4E2904_enchantment_by_potion_lut[] = {
2034  (ITEM_ENCHANTMENT)59};
2035  item->special_enchantment = _4E2904_enchantment_by_potion_lut
2036  [pParty->pPickedItem.uItemID - 240];
2037  v31 = (double)(1800 * pParty->pPickedItem.uEnchantmentType);
2038  }
2039 
2040  item->expirte_time =
2042  item->uAttributes = alchemy_skill_level | 0x18;
2043 
2047  return;
2048  }
2049  GameUI_DrawItemInfo(item);
2050  return;
2051  }
2052 
2053  // use reagents(применение реагентов)
2056  item->uItemID == ITEM_POTION_BOTTLE) {
2057  item->uEnchantmentType =
2058  alchemy_skill_points + pParty->pPickedItem.GetDamageDice();
2059  switch (pParty->pPickedItem.uItemID) {
2062  case ITEM_TROLL_BLOOD:
2063  case ITEM_TROLL_RUBY:
2064  case ITEM_DRAGON_EYE:
2066  break;
2067 
2068  case ITEM_PHIMA_ROOT:
2070  case ITEM_HARPY_FEATHER:
2071  case ITEM_MOONSTONE:
2072  case ITEM_ELVISH_TOADSTOOL:
2074  break;
2075 
2076  case ITEM_POPPYSNAPS:
2077  case ITEM_FAE_DUST:
2078  case ITEM_SULFUR:
2079  case ITEM_GARNET:
2080  case ITEM_DEVIL_ICHOR:
2082  break;
2083 
2084  case ITEM_MUSHROOM:
2085  case ITEM_OBSIDIAN:
2087  case ITEM_MERCURY:
2089  item->uItemID = ITEM_POTION_CATALYST;
2090  break;
2091  default:
2092  break;
2093  }
2096  if (dword_4E455C) {
2098  dword_4E455C = 0;
2099  }
2100  return;
2101  }
2102 
2103  // potions mixing(смешивание двух зелий)
2106  item->uItemID >= ITEM_POTION_CATALYST &&
2107  item->uItemID <= ITEM_POTION_REJUVENATION) {
2108  potion1_id = item->uItemID - ITEM_POTION_CURE_WOUNDS;
2110 
2112  item->uItemID == ITEM_POTION_CATALYST)
2113  potionID = 5;
2114  else
2115  potionID = pItemsTable->potion_data[potion2_id][potion1_id];
2116 
2117  damage_level = 0;
2118  if (alchemy_skill_points) {
2119  if (potionID < ITEM_POTION_CURE_DISEASE ||
2120  potionID > ITEM_POTION_AWAKEN) { // < 225 >227
2121  if (potionID >= ITEM_POTION_HASTE &&
2122  potionID <= ITEM_POTION_CURE_INSANITY &&
2123  alchemy_skill_level == 1) // 228 >= potionID <= 239
2124  damage_level = 2;
2125  if (potionID >= ITEM_POTION_MIGHT_BOOST &&
2126  potionID <= ITEM_POTION_BODY_RESISTANE &&
2127  alchemy_skill_level <= 2) // 240 >= potionID <= 261
2128  damage_level = 3;
2129  if (potionID >= ITEM_POTION_STONE_TO_FLESH &&
2130  alchemy_skill_level <= 3) // 262 < potionID
2131  damage_level = 4;
2132  }
2133  } else { // no skill(нет навыка)
2134  if (potionID >= ITEM_POTION_CURE_DISEASE &&
2135  potionID <= ITEM_POTION_AWAKEN) // 225 <= v16 <= 227
2136  damage_level = 1;
2137  if (potionID >= ITEM_POTION_HASTE &&
2138  potionID <= ITEM_POTION_CURE_INSANITY) // 228 <= v16 <= 239
2139  damage_level = 2;
2140  if (potionID >= ITEM_POTION_MIGHT_BOOST &&
2141  potionID <= ITEM_POTION_BODY_RESISTANE) // 240 <= v16 <= 261
2142  damage_level = 3;
2143  if (potionID >= ITEM_POTION_STONE_TO_FLESH) // 262 <= v16
2144  damage_level = 4;
2145  }
2146 
2147  int item_pid = pPlayers[uActiveCharacter]->GetItemListAtInventoryIndex(
2148  invMatrixIndex);
2149  // int pOut_x = item_pid + 1;
2150  // for (uint i = 0; i < 126; ++i)
2151  //{
2152  // if (pPlayers[uActiveCharacter]->pInventoryMatrix[i] == pOut_x)
2153  // {
2154  // pOut_y = i;
2155  // break;
2156  //}
2157  //}
2158  if (!potionID) {
2159  GameUI_DrawItemInfo(item);
2160  return;
2161  }
2162 
2163  if (damage_level > 0) {
2164  pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(
2165  invMatrixIndex); // pOut_y); ?? quickfix needs checking
2166 
2167  if (damage_level == 1) {
2168  pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 11 + 10,
2169  DMGT_FIRE);
2170  } else if (damage_level == 2) {
2171  pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 71 + 30,
2172  DMGT_FIRE);
2173  pPlayers[uActiveCharacter]->ItemsPotionDmgBreak(1); // break 1
2174  } else if (damage_level == 3) {
2175  pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 201 + 50,
2176  DMGT_FIRE);
2177  pPlayers[uActiveCharacter]->ItemsPotionDmgBreak(5); // break 5
2178  } else if (damage_level >= 4) {
2180  0);
2181  pPlayers[uActiveCharacter]->ItemsPotionDmgBreak(
2182  0); // break everything
2183  }
2184 
2185  pAudioPlayer->PlaySound(SOUND_fireBall, 0, 0, -1, 0, 0);
2186  pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
2187  v39.z = pParty->vPosition.z + pParty->sEyelevel;
2188  v39.x = pParty->vPosition.x;
2189  v39.y = pParty->vPosition.y;
2190 
2191  int rot_x, rot_y, rot_z;
2192  Vec3_int_::Rotate(64, pParty->sRotationY, pParty->sRotationX, v39,
2193  &rot_x, &rot_y, &rot_z);
2195  SPRITE_SPELL_FIRE_FIREBALL_IMPACT, rot_x, rot_y, rot_z, 0, 1, 0,
2196  0, 0);
2197  if (dword_4E455C) {
2198  if (pPlayers[uActiveCharacter]->CanAct())
2199  pPlayers[uActiveCharacter]->PlaySound(SPEECH_17, 0);
2201  localization->GetString(444)); // Ouch! Ой!
2202  dword_4E455C = 0;
2203  }
2206  return;
2207  } else { // if ( damage_level == 0 )
2208  if (alchemy_skill_points) {
2209  if (item->uItemID == ITEM_POTION_CATALYST ||
2211  if (item->uItemID == ITEM_POTION_CATALYST)
2212  item->uItemID = pParty->pPickedItem.uItemID;
2214  item->uEnchantmentType =
2216  } else {
2217  item->uItemID = potionID;
2218  item->uEnchantmentType =
2220  item->uEnchantmentType) /
2221  2;
2222  pPlayers[uActiveCharacter]->SetVariable(
2223  VAR_AutoNotes,
2224  pItemsTable->potion_note[potion1_id][potion2_id]);
2225  }
2226  int bottle =
2228  if (bottle)
2230  ->pOwnItems[bottle - 1]
2231  .uAttributes = ITEM_IDENTIFIED;
2232  if (!(pItemsTable->pItems[item->uItemID].uItemID_Rep_St))
2233  item->uAttributes |= 1;
2234  if (!dword_4E455C) {
2237  return;
2238  }
2240  dword_4E455C = 0;
2243  return;
2244  }
2245  GameUI_DrawItemInfo(item);
2246  return;
2247  }
2248  }
2249 
2250  GameUI_DrawItemInfo(item);
2251  return;
2252 }
2253 
2254 //----- (0045828B) --------------------------------------------------------
2255 unsigned int GetSpellColor(signed int a1) {
2256  if (a1 == 0) return Color16(0, 0, 0);
2257  if (a1 < 12) return Color16(255, 85, 0);
2258  if (a1 < 23) return Color16(150, 212, 255);
2259  if (a1 < 34) return Color16(0, 128, 255);
2260  if (a1 < 45) return Color16(128, 128, 128);
2261  if (a1 < 56) return Color16(225, 225, 225);
2262  if (a1 < 67) return Color16(235, 15, 255);
2263  if (a1 < 78) return Color16(255, 128, 0);
2264  if (a1 < 89) return Color16(255, 255, 155);
2265  if (a1 < 100)
2266  return Color16(192, 192, 240);
2267  else
2268  __debugbreak();
2269 }
2270 
2271 //----- (004B46F8) --------------------------------------------------------
2272 unsigned __int64 GetExperienceRequiredForLevel(int level) {
2273  int effectiveLevel = 0;
2274  for (int i = 0; i < level; ++i)
2275  effectiveLevel += i + 1;
2276  return (unsigned __int64)(1000 * effectiveLevel);
2277 }
Party::pPickedItem
ItemGen pPickedItem
Definition: Party.h:312
uint16_t
unsigned __int16 uint16_t
Definition: SDL_config.h:37
UIPopup.h
UIMSG_PlayerCreationClickPlus
@ UIMSG_PlayerCreationClickPlus
Definition: GUIWindow.h:48
ITEM_POTION_HARDEN_ITEM
@ ITEM_POTION_HARDEN_ITEM
Definition: Items.h:129
EQUIP_HELMET
@ EQUIP_HELMET
Definition: Items.h:232
UIMSG_PlayerCreationRemoveDownSkill
@ UIMSG_PlayerCreationRemoveDownSkill
Definition: GUIWindow.h:61
GUIWindow::DrawText
void DrawText(GUIFont *font, int x, int y, unsigned short uFontColor, const char *str, bool present_time_transparency=false, int max_text_height=0, int uFontShadowColor=0)
Definition: GUIWindow.cpp:694
pPlayerConditionAttributeDescription
char * pPlayerConditionAttributeDescription
Definition: mm7_data.cpp:655
Party::vPosition
Vec3_int_ vPosition
Definition: Party.h:250
Engine_::IocContainer
Definition: IocContainer.h:15
ui_character_tooltip_header_default_color
unsigned int ui_character_tooltip_header_default_color
Definition: UICharacter.cpp:42
GetNPCData
NPCData * GetNPCData(signed int npcid)
Definition: NPC.cpp:43
PLAYER_SKILL_MONSTER_ID
@ PLAYER_SKILL_MONSTER_ID
Definition: Player.h:203
ItemGen::GetDamageMod
unsigned __int8 GetDamageMod()
Definition: Items.cpp:1533
GUIWindow::uFrameW
unsigned int uFrameW
Definition: GUIWindow.h:473
dword_4E455C
int dword_4E455C
Definition: mm7_data.cpp:246
messagebox_border_left
Image * messagebox_border_left
Definition: UIPopup.cpp:47
Localization::GetString
const char * GetString(unsigned int index) const
Definition: Localization.cpp:13
NPCData::uProfession
unsigned int uProfession
Definition: NPC.h:89
Localization::GetCharacterConditionName
const char * GetCharacterConditionName(unsigned int index) const
Definition: Localization.h:75
GameUI_DrawItemInfo
void GameUI_DrawItemInfo(struct ItemGen *inspect_item)
Definition: UIPopup.cpp:168
Dying
@ Dying
Definition: Actor.h:79
UIMSG_Escape
@ UIMSG_Escape
Definition: GUIWindow.h:96
SOUND_fireBall
@ SOUND_fireBall
Definition: AudioPlayer.h:14
Viewport.h
ACTOR_BUFF_PAIN_REFLECTION
@ ACTOR_BUFF_PAIN_REFLECTION
Definition: Actor.h:58
Timer::uTimeElapsed
unsigned int uTimeElapsed
Definition: Time.h:133
LOD.h
Image::GetHeight
unsigned int GetHeight()
Definition: Image.cpp:230
SPEECH_IDENTIFY_MONSTER_STRONGER
@ SPEECH_IDENTIFY_MONSTER_STRONGER
Definition: Player.h:151
Party::GetPlayingTime
GameTime & GetPlayingTime()
Definition: Party.h:230
ITEM_OBSIDIAN
@ ITEM_OBSIDIAN
Definition: Items.h:116
ITEM_POPPYSNAPS
@ ITEM_POPPYSNAPS
Definition: Items.h:110
DrawPopupWindow
void DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight)
Definition: UIPopup.cpp:89
Mouse::GetCursorPos
Point GetCursorPos()
Definition: Mouse.cpp:108
GUIWindow
Definition: GUIWindow.h:433
ITEM_DRAGON_EYE
@ ITEM_DRAGON_EYE
Definition: Items.h:104
EQUIP_CLOAK
@ EQUIP_CLOAK
Definition: Items.h:234
Mouse
Definition: Mouse.h:279
Rect::x
int x
Definition: Rect.h:4
messagebox_border_top
Image * messagebox_border_top
Definition: UIPopup.cpp:45
pSpriteFrameTable
struct SpriteFrameTable * pSpriteFrameTable
Definition: Sprites.cpp:22
ITEM_POTION_CATALYST
@ ITEM_POTION_CATALYST
Definition: Items.h:121
pConditionImportancyTable
std::array< unsigned int, 18 > pConditionImportancyTable
Definition: Player.cpp:197
EQUIP_BELT
@ EQUIP_BELT
Definition: Items.h:233
pSpriteObjects
std::array< SpriteObject, MAX_SPRITE_OBJECTS > pSpriteObjects
Definition: SpriteObject.cpp:34
Viewport::uViewportTL_Y
int uViewportTL_Y
Definition: Viewport.h:23
pMindResistanceAttributeDescription
char * pMindResistanceAttributeDescription
Definition: mm7_data.cpp:668
OBJECT_Item
@ OBJECT_Item
Definition: Actor.h:66
Mouse::uMouseClickY
unsigned int uMouseClickY
Definition: Mouse.h:365
pMonsterStats
struct MonsterStats * pMonsterStats
Definition: Monsters.cpp:8
pSRZBufferLineOffsets
std::array< unsigned int, 480 > pSRZBufferLineOffsets
Definition: mm7_data.cpp:511
ItemGen::GetItemEquipType
ITEM_EQUIP_TYPE GetItemEquipType()
Definition: Items.cpp:1504
Party::sRotationX
int sRotationX
Definition: Party.h:252
ItemGen::SetIdentified
void SetIdentified()
Definition: Items.h:307
pGUIWindow_CurrentMenu
GUIWindow * pGUIWindow_CurrentMenu
Definition: GUIWindow.cpp:54
Rect::w
int w
Definition: Rect.h:7
SpellStats::pInfos
SpellInfo pInfos[100]
Definition: Spells.h:192
DMGT_FIRE
@ DMGT_FIRE
Definition: Items.h:11
ACTOR_BUFF_DAY_OF_PROTECTION
@ ACTOR_BUFF_DAY_OF_PROTECTION
Definition: Actor.h:51
EQUIP_SHIELD
@ EQUIP_SHIELD
Definition: Items.h:231
uPlayerCreationUI_SelectedCharacter
unsigned int uPlayerCreationUI_SelectedCharacter
Definition: mm7_data.cpp:761
GameUI_DrawNPCPopup
void GameUI_DrawNPCPopup(void *_this)
Definition: UIGame.cpp:891
GUIButton::uZ
unsigned int uZ
Definition: GUIButton.h:25
CURRENT_SCREEN::SCREEN_CHEST
@ SCREEN_CHEST
ITEM_ENCHANTMENT_OF_FLAME
@ ITEM_ENCHANTMENT_OF_FLAME
Definition: Items.h:48
ANIM_Standing
@ ANIM_Standing
Definition: Actor.h:99
level
GLint level
Definition: SDL_opengl.h:1572
SkillToMastery
unsigned int SkillToMastery(unsigned int skill_value)
Definition: Player.cpp:7854
CURRENT_SCREEN::SCREEN_SPELL_BOOK
@ SCREEN_SPELL_BOOK
Actor
Definition: Actor.h:151
Party::sEyelevel
int sEyelevel
Definition: Party.h:239
AudioPlayer::PlaySound
void PlaySound(SoundID eSoundID, int pid, unsigned int uNumRepeats, int x, int y, int a7)
Definition: AudioPlayer.cpp:195
SpriteObject.h
messagebox_border_right
Image * messagebox_border_right
Definition: UIPopup.cpp:48
EQUIP_REAGENT
@ EQUIP_REAGENT
Definition: Items.h:240
Rect::z
int z
Definition: Rect.h:6
CURRENT_SCREEN::SCREEN_CASTING
@ SCREEN_CASTING
Texture
Definition: Texture.h:4
game_viewport_width
unsigned int game_viewport_width
Definition: mm7_data.cpp:194
SummonedItem::field_4_expire_minute
int field_4_expire_minute
Definition: Items.h:584
SpellInfo::pName
char * pName
Definition: Spells.h:176
ITEM_HARDENED
@ ITEM_HARDENED
Definition: Items.h:35
SOUND_error
@ SOUND_error
Definition: AudioPlayer.h:19
ACTOR_BUFF_HEROISM
@ ACTOR_BUFF_HEROISM
Definition: Actor.h:56
ITEM_MERCURY
@ ITEM_MERCURY
Definition: Items.h:118
UIMSG_PlayerCreationClickOK
@ UIMSG_PlayerCreationClickOK
Definition: GUIWindow.h:52
GetExperienceRequiredForLevel
unsigned __int64 GetExperienceRequiredForLevel(int level)
Definition: UIPopup.cpp:2272
UIMSG_PlayerCreationClickMinus
@ UIMSG_PlayerCreationClickMinus
Definition: GUIWindow.h:49
game_starting_year
int game_starting_year
Definition: mm7_data.cpp:193
localization
Localization * localization
Definition: Localization.cpp:11
CharacterUI_DrawTooltip
void CharacterUI_DrawTooltip(const char *title, String &content)
Definition: UIPopup.cpp:51
Point::x
unsigned int x
Definition: Point.h:7
MENU_MAIN
@ MENU_MAIN
Definition: GUIWindow.h:251
ITEM_POTION_HASTE
@ ITEM_POTION_HASTE
Definition: Items.h:127
ITEM_ENCHANTMENT_OF_POISON
@ ITEM_ENCHANTMENT_OF_POISON
Definition: Items.h:50
PaletteManager.h
messagebox_border_bottom
Image * messagebox_border_bottom
Definition: UIPopup.cpp:46
Party::pPlayers
std::array< Player, 4 > pPlayers
Definition: Party.h:310
SPEECH_DO_POTION_FINE
@ SPEECH_DO_POTION_FINE
Definition: Player.h:62
GUIWindow::DrawTitleText
void DrawTitleText(GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const char *pInString, int line_spacing)
Definition: GUIWindow.cpp:665
EQUIP_GOLD
@ EQUIP_GOLD
Definition: Items.h:246
GUIFont::GetLineWidth
unsigned int GetLineWidth(const String &str)
Definition: GUIFont.cpp:278
ITEM_POTION_BODY_RESISTANE
@ ITEM_POTION_BODY_RESISTANE
Definition: Items.h:135
GUIFont.h
ITEM_POTION_SWIFT_POTION
@ ITEM_POTION_SWIFT_POTION
Definition: Items.h:134
ItemsTable::potion_note
unsigned __int16 potion_note[50][50]
Definition: Items.h:469
ACTOR_BUFF_SLOWED
@ ACTOR_BUFF_SLOWED
Definition: Actor.h:45
SpellInfo
Definition: Spells.h:175
GUIFont::GetHeight
unsigned int GetHeight() const
Definition: GUIFont.cpp:84
CharacterUI_StatsTab_ShowHint
void CharacterUI_StatsTab_ShowHint()
Definition: UIPopup.cpp:1153
pSpellPointsAttributeDescription
char * pSpellPointsAttributeDescription
Definition: mm7_data.cpp:653
SPEECH_17
@ SPEECH_17
Definition: Player.h:63
ITEM_POTION_CURE_DISEASE
@ ITEM_POTION_CURE_DISEASE
Definition: Items.h:125
pPlayers
NZIArray< struct Player *, 5 > pPlayers
Definition: Player.cpp:46
pFontCreate
GUIFont * pFontCreate
Definition: GUIFont.cpp:22
GUIWindow::uFrameWidth
unsigned int uFrameWidth
Definition: GUIWindow.h:470
Localization::GetSkillName
const char * GetSkillName(unsigned int index) const
Definition: Localization.h:51
GUIButton
Definition: GUIButton.h:11
CharacterUI_GetSkillDescText
String CharacterUI_GetSkillDescText(unsigned int uPlayerID, PLAYER_SKILL_TYPE uPlayerSkillType)
Definition: UIPopup.cpp:1044
GUIWindow::uFrameZ
unsigned int uFrameZ
Definition: GUIWindow.h:472
Chest.h
Engine.h
current_screen_type
enum CURRENT_SCREEN current_screen_type
Definition: GUIWindow.cpp:83
ItemGen::uEnchantmentType
int uEnchantmentType
Definition: Items.h:327
ACTOR_BUFF_AFRAID
@ ACTOR_BUFF_AFRAID
Definition: Actor.h:42
pFastSpellAttributeDescription
char * pFastSpellAttributeDescription
Definition: mm7_data.cpp:656
ITEM_POTION_MAGIC_POTION
@ ITEM_POTION_MAGIC_POTION
Definition: Items.h:123
ACTOR_BUFF_FATE
@ ACTOR_BUFF_FATE
Definition: Actor.h:49
Dead
@ Dead
Definition: Actor.h:80
pArmourClassAttributeDescription
char * pArmourClassAttributeDescription
Definition: mm7_data.cpp:654
SPEECH_10
@ SPEECH_10
Definition: Player.h:56
ACTOR_BUFF_SHRINK
@ ACTOR_BUFF_SHRINK
Definition: Actor.h:41
SPEECH_IDENTIFY_MONSTER_WEAKER
@ SPEECH_IDENTIFY_MONSTER_WEAKER
Definition: Player.h:150
Party::pPartyBuffs
std::array< SpellBuff, 20 > pPartyBuffs
Definition: Party.h:309
ITEM_STOLEN
@ ITEM_STOLEN
Definition: Items.h:34
GUIWindow::vButtons
std::vector< GUIButton * > vButtons
Definition: GUIWindow.h:489
messagebox_corner_w
Image * messagebox_corner_w
Definition: UIPopup.cpp:44
OBJECT_Actor
@ OBJECT_Actor
Definition: Actor.h:67
SPEECH_9
@ SPEECH_9
Definition: Player.h:55
Events.h
Mouse::uMouseClickX
unsigned int uMouseClickX
Definition: Mouse.h:364
Actor.h
GetCurrentMenuID
MENU_STATE GetCurrentMenuID()
Definition: GUIWindow.cpp:133
dword_507B00_spell_info_to_draw_in_popup
int dword_507B00_spell_info_to_draw_in_popup
Definition: mm7_data.cpp:554
ITEM_METEORITE_FRAGMENT
@ ITEM_METEORITE_FRAGMENT
Definition: Items.h:106
ITEM_PHIMA_ROOT
@ ITEM_PHIMA_ROOT
Definition: Items.h:105
ITEM_POTION_RECHARGE_ITEM
@ ITEM_POTION_RECHARGE_ITEM
Definition: Items.h:128
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
CURRENT_SCREEN::SCREEN_E
@ SCREEN_E
current_character_screen_window
enum WindowType current_character_screen_window
Definition: GUIWindow.cpp:78
Localization.h
SummonedItem::Initialize
void Initialize(GameTime duration)
Definition: Items.h:573
ItemGen::uAttributes
unsigned int uAttributes
Definition: Items.h:349
ITEM_ELVISH_TOADSTOOL
@ ITEM_ELVISH_TOADSTOOL
Definition: Items.h:109
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
UIMSG_0
@ UIMSG_0
Definition: GUIWindow.h:14
ItemGen::special_enchantment
ITEM_ENCHANTMENT special_enchantment
Definition: Items.h:330
Image::GetWidth
unsigned int GetWidth()
Definition: Image.cpp:217
CharacterUI_SkillsTab_ShowHint
void CharacterUI_SkillsTab_ShowHint()
Definition: UIPopup.cpp:1127
ItemGen::uMaxCharges
char uMaxCharges
Definition: Items.h:351
parchment
Texture * parchment
Definition: UIPopup.cpp:40
CURRENT_SCREEN::SCREEN_PARTY_CREATION
@ SCREEN_PARTY_CREATION
MonsterPopup_Draw
void MonsterPopup_Draw(unsigned int uActorID, GUIWindow *pWindow)
Definition: UIPopup.cpp:563
GUIButton.h
SPEECH_11
@ SPEECH_11
Definition: Player.h:57
ITEM_POTION_SLAYING_POTION
@ ITEM_POTION_SLAYING_POTION
Definition: Items.h:137
pParty
Party * pParty
Definition: Party.cpp:30
Engine_::IocContainer::ResolveVis
static Vis * ResolveVis()
Definition: IocContainer.cpp:110
Image
Definition: Image.h:19
MapBook.h
Localization::GetSkillDescriptionExpert
const char * GetSkillDescriptionExpert(unsigned int index) const
Definition: Localization.h:63
UIMSG_SkillUp
@ UIMSG_SkillUp
Definition: GUIWindow.h:104
Localization::GetSkillDescriptionNormal
const char * GetSkillDescriptionNormal(unsigned int index) const
Definition: Localization.h:59
ItemEnchantment::pBonusStat
char * pBonusStat
Definition: Items.h:405
ITEM_POTION_CURE_WEAKNESS
@ ITEM_POTION_CURE_WEAKNESS
Definition: Items.h:124
pFontArrus
GUIFont * pFontArrus
Definition: GUIFont.cpp:18
SummonedItem::field_18_expire_year
int field_18_expire_year
Definition: Items.h:589
Actor::uCurrentActionTime
unsigned int uCurrentActionTime
Definition: Actor.h:312
ACTOR_BUFF_CHARM
@ ACTOR_BUFF_CHARM
Definition: Actor.h:39
NPCData::pName
char * pName
Definition: NPC.h:82
ITEM_POTION_STONE_TO_FLESH
@ ITEM_POTION_STONE_TO_FLESH
Definition: Items.h:136
EQUIP_ARMOUR
@ EQUIP_ARMOUR
Definition: Items.h:230
format_4E2DE8
const char * format_4E2DE8
Definition: mm7_data.cpp:242
ACTOR_BUFF_PARALYZED
@ ACTOR_BUFF_PARALYZED
Definition: Actor.h:44
GetSpellColor
unsigned int GetSpellColor(signed int a1)
Definition: UIPopup.cpp:2255
ACTOR_BUFF_MASS_DISTORTION
@ ACTOR_BUFF_MASS_DISTORTION
Definition: Actor.h:48
ItemGen::GetDisplayName
String GetDisplayName()
Definition: Items.cpp:610
Localization::GetAttributeDescription
const char * GetAttributeDescription(unsigned int index) const
Definition: Localization.h:47
ITEM_MOONSTONE
@ ITEM_MOONSTONE
Definition: Items.h:108
ITEM_TEMP_BONUS
@ ITEM_TEMP_BONUS
Definition: Items.h:28
ITEM_TROLL_BLOOD
@ ITEM_TROLL_BLOOD
Definition: Items.h:102
EQUIP_SINGLE_HANDED
@ EQUIP_SINGLE_HANDED
Definition: Items.h:227
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
pMissleDamageAttributeDescription
char * pMissleDamageAttributeDescription
Definition: mm7_data.cpp:663
pHealthPointsAttributeDescription
char * pHealthPointsAttributeDescription
Definition: mm7_data.cpp:652
WINDOW_CharacterWindow_Inventory
@ WINDOW_CharacterWindow_Inventory
Definition: GUIWindow.h:330
GetSkillColor
unsigned int GetSkillColor(unsigned int uPlayerClass, PLAYER_SKILL_TYPE uPlayerSkillType, signed int skill_level)
Definition: GUIWindow.cpp:1366
SpriteFrameTable::GetFrame
SpriteFrame * GetFrame(unsigned int uSpriteID, unsigned int uTime)
Definition: Sprites.cpp:277
viewparams
struct ViewingParams * viewparams
Definition: mm7_data.cpp:22
no_rightlick_in_inventory
int no_rightlick_in_inventory
Definition: UIPopup.cpp:1815
PLAYER_SKILL_TYPE
PLAYER_SKILL_TYPE
Definition: Player.h:170
ITEM_ENCHANTMENT_40
@ ITEM_ENCHANTMENT_40
Definition: Items.h:58
GUIWindow::DrawMessageBox
void DrawMessageBox(bool inside_game_viewport)
Definition: GUIWindow.cpp:319
CURRENT_SCREEN::SCREEN_HOUSE
@ SCREEN_HOUSE
MonsterInfo::uID
uint16_t uID
Definition: Monsters.h:169
ACTOR_BUFF_SOMETHING_THAT_HALVES_AC
@ ACTOR_BUFF_SOMETHING_THAT_HALVES_AC
Definition: Actor.h:46
pPlayerExperienceAttributeDescription
char * pPlayerExperienceAttributeDescription
Definition: mm7_data.cpp:659
ItemGen::GetIconName
char * GetIconName()
Definition: Items.cpp:1521
MonsterStats::pPlaceStrings
char * pPlaceStrings[31]
Definition: Monsters.h:195
ItemGen::uItemID
int uItemID
Definition: Items.h:326
AssetsManager::GetImage_ColorKey
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
Definition: AssetsManager.cpp:34
ITEM_FAE_DUST
@ ITEM_FAE_DUST
Definition: Items.h:111
pSpellDatas
std::array< SpellData, 100 > pSpellDatas
Definition: Spells.cpp:170
GUIWindow::uFrameHeight
unsigned int uFrameHeight
Definition: GUIWindow.h:471
Localization::GetSpellSchoolName
const char * GetSpellSchoolName(unsigned int index) const
Definition: Localization.h:27
MapBookOpen
int MapBookOpen
Definition: mm7_data.cpp:519
EQUIP_BOW
@ EQUIP_BOW
Definition: Items.h:229
GetConditionDrawColor
int GetConditionDrawColor(unsigned int uConditionIdx)
Definition: UIGame.cpp:2327
Engine_::IocContainer::ResolveMouse
static Mouse * ResolveMouse()
Definition: IocContainer.cpp:88
ITEM_LASER_RIFLE
@ ITEM_LASER_RIFLE
Definition: Items.h:83
CURRENT_SCREEN::SCREEN_CHARACTERS
@ SCREEN_CHARACTERS
ACTOR_BUFF_HASTE
@ ACTOR_BUFF_HASTE
Definition: Actor.h:57
ItemGen::expirte_time
GameTime expirte_time
Definition: Items.h:354
pMissleBonusAttributeDescription
char * pMissleBonusAttributeDescription
Definition: mm7_data.cpp:662
SummonedItem::field_C_expire_day
int field_C_expire_day
Definition: Items.h:586
ItemGen::GetDamageDice
unsigned __int8 GetDamageDice()
Definition: Items.cpp:1525
GUIButton::msg
UIMessageType msg
Definition: GUIButton.h:29
ITEM_BLASTER
@ ITEM_BLASTER
Definition: Items.h:82
ItemGen::GetDamageRoll
unsigned __int8 GetDamageRoll()
Definition: Items.cpp:1529
AudioPlayer::StopChannels
void StopChannels(int uStartChannel, int uEndChannel)
Definition: AudioPlayer.cpp:331
RightClickPortraitXmin
std::array< __int16, 4 > RightClickPortraitXmin
Definition: mm7_data.cpp:225
Localization::GetSkillDescriptionGrand
const char * GetSkillDescriptionGrand(unsigned int index) const
Definition: Localization.h:71
GUIFont::CalcTextHeight
unsigned int CalcTextHeight(const String &str, unsigned int width, int x_offset, bool return_on_carriage=false)
Definition: GUIFont.cpp:246
pActors
std::array< Actor, 500 > pActors
Definition: Actor.cpp:38
SpriteFrameTable::pSpriteSFrames
SpriteFrame * pSpriteSFrames
Definition: Sprites.h:77
Party.h
SummonedItem::field_14_exprie_month
int field_14_exprie_month
Definition: Items.h:588
ITEM_OOZE_ENDOPLASM_VIAL
@ ITEM_OOZE_ENDOPLASM_VIAL
Definition: Items.h:117
Localization::GetSkillDescription
const char * GetSkillDescription(unsigned int index) const
Definition: Localization.h:55
ITEM_POTION_CURE_WOUNDS
@ ITEM_POTION_CURE_WOUNDS
Definition: Items.h:122
Localization::GetClassDescription
const char * GetClassDescription(unsigned int index) const
Definition: Localization.h:39
back_to_game
void back_to_game()
Definition: Engine.cpp:1609
Viewport::uViewportBR_X
int uViewportBR_X
Definition: Viewport.h:24
UIMSG_PlayerCreation_SelectAttribute
@ UIMSG_PlayerCreation_SelectAttribute
Definition: GUIWindow.h:101
ITEM_GARNET
@ ITEM_GARNET
Definition: Items.h:113
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
MonsterStats::pInfos
MonsterInfo pInfos[265]
Definition: Monsters.h:194
Mouse::GetClickPos
void GetClickPos(unsigned int *pX, unsigned int *pY)
Definition: Mouse.cpp:20
EQUIP_POTION
@ EQUIP_POTION
Definition: Items.h:241
ITEM_POTION_FLAMING_POTION
@ ITEM_POTION_FLAMING_POTION
Definition: Items.h:133
Timer::Pause
void Pause()
Definition: Time.cpp:19
Rect
Definition: Rect.h:3
pAttackDamageAttributeDescription
char * pAttackDamageAttributeDescription
Definition: mm7_data.cpp:661
SpellInfo::pExpertSkillDesc
char * pExpertSkillDesc
Definition: Spells.h:180
ITEM_MUSHROOM
@ ITEM_MUSHROOM
Definition: Items.h:115
UIMSG_44
@ UIMSG_44
Definition: GUIWindow.h:54
ANIM_AtkMelee
@ ANIM_AtkMelee
Definition: Actor.h:101
SummonedItem
Definition: Items.h:571
ITEM_ENCHANTMENT
ITEM_ENCHANTMENT
Definition: Items.h:38
ItemGen::IsIdentified
bool IsIdentified()
Definition: Items.h:306
SPEECH_IDENTIFY_MONSTER_106
@ SPEECH_IDENTIFY_MONSTER_106
Definition: Player.h:152
EQUIP_AMULET
@ EQUIP_AMULET
Definition: Items.h:238
ITEM_AURA_EFFECT_RED
@ ITEM_AURA_EFFECT_RED
Definition: Items.h:29
pBodyResistanceAttributeDescription
char * pBodyResistanceAttributeDescription
Definition: mm7_data.cpp:669
GUIWindow::uFrameY
unsigned int uFrameY
Definition: GUIWindow.h:469
Viewport::uViewportBR_Y
int uViewportBR_Y
Definition: Viewport.h:25
ItemGen::GetIdentifiedName
String GetIdentifiedName()
Definition: Items.cpp:619
pMiscTimer
Timer * pMiscTimer
Definition: Time.cpp:7
ringscreenactive
bool ringscreenactive()
Definition: UICharacter.cpp:3396
UIMSG_PlayerCreationSelectClass
@ UIMSG_PlayerCreationSelectClass
Definition: GUIWindow.h:51
GUIButton::uX
unsigned int uX
Definition: GUIButton.h:21
pSpellStats
struct SpellStats * pSpellStats
Definition: Spells.cpp:32
ITEM_POTION_AWAKEN
@ ITEM_POTION_AWAKEN
Definition: Items.h:126
PLAYER_SKILL_ALCHEMY
@ PLAYER_SKILL_ALCHEMY
Definition: Player.h:206
pFontComic
GUIFont * pFontComic
Definition: GUIFont.cpp:24
CURRENT_SCREEN::SCREEN_BOOKS
@ SCREEN_BOOKS
GUIButton::uW
unsigned int uW
Definition: GUIButton.h:26
Localization::GetAttirubteName
const char * GetAttirubteName(unsigned int index) const
Definition: Localization.h:43
ItemGen::IsBroken
bool IsBroken()
Definition: Items.h:304
ItemsTable::pSpecialEnchantments
ItemSpecialEnchantment pSpecialEnchantments[72]
Definition: Items.h:462
ITEM_SULFUR
@ ITEM_SULFUR
Definition: Items.h:112
EQUIP_TWO_HANDED
@ EQUIP_TWO_HANDED
Definition: Items.h:228
AudioPlayer.h
vChests
std::vector< Chest > vChests
Definition: Chest.cpp:39
messagebox_corner_y
Image * messagebox_corner_y
Definition: UIPopup.cpp:42
SummonedItem::field_8_expire_hour
int field_8_expire_hour
Definition: Items.h:585
pViewport
struct Viewport * pViewport
Definition: mm7_data.cpp:21
ACTOR_BUFF_HOUR_OF_POWER
@ ACTOR_BUFF_HOUR_OF_POWER
Definition: Actor.h:52
ItemGen::uNumCharges
int uNumCharges
Definition: Items.h:348
UICharacter.h
CURRENT_SCREEN::SCREEN_GAME
@ SCREEN_GAME
UIMSG_PlayerCreationClickReset
@ UIMSG_PlayerCreationClickReset
Definition: GUIWindow.h:53
dword_507BF0_is_there_popup_onscreen
int dword_507BF0_is_there_popup_onscreen
Definition: mm7_data.cpp:556
ITEM_HARPY_FEATHER
@ ITEM_HARPY_FEATHER
Definition: Items.h:107
Inventory_ItemPopupAndAlchemy
void Inventory_ItemPopupAndAlchemy()
Definition: UIPopup.cpp:1817
UIShops.h
ACTOR_BUFF_SHIELD
@ ACTOR_BUFF_SHIELD
Definition: Actor.h:53
Point::y
unsigned int y
Definition: Point.h:8
UIMSG_PlayerCreationSelectActiveSkill
@ UIMSG_PlayerCreationSelectActiveSkill
Definition: GUIWindow.h:50
Rect::y
int y
Definition: Rect.h:5
GUIButton::msg_param
unsigned int msg_param
Definition: GUIButton.h:30
RightClickPortraitXmax
std::array< __int16, 4 > RightClickPortraitXmax
Definition: mm7_data.cpp:226
ACTOR_BUFF_STONED
@ ACTOR_BUFF_STONED
Definition: Actor.h:43
ANIM_Bored
@ ANIM_Bored
Definition: Actor.h:106
Texture.h
UIMSG_48
@ UIMSG_48
Definition: GUIWindow.h:58
UIStatusBar.h
v2
GLfloat GLfloat GLfloat v2
Definition: SDL_opengl_glext.h:695
messagebox_corner_x
Image * messagebox_corner_x
Definition: UIPopup.cpp:41
SpriteFrame
Definition: Sprites.h:39
messagebox_corner_z
Image * messagebox_corner_z
Definition: UIPopup.cpp:43
ITEM_IDENTIFIED
@ ITEM_IDENTIFIED
Definition: Items.h:26
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
uint
unsigned int uint
Definition: MM7.h:4
ITEM_ENCHANTMENT_OF_FROST
@ ITEM_ENCHANTMENT_OF_FROST
Definition: Items.h:42
uActiveCharacter
unsigned int uActiveCharacter
Definition: mm7_data.cpp:555
v3
GLfloat GLfloat GLfloat GLfloat v3
Definition: SDL_opengl_glext.h:696
Localization::FormatString
String FormatString(unsigned int index,...) const
Definition: Localization.cpp:17
GUIButton::uY
unsigned int uY
Definition: GUIButton.h:22
__debugbreak
void __cdecl __debugbreak(void)
EQUIP_WAND
@ EQUIP_WAND
Definition: Items.h:239
ITEM_POTION_BOTTLE
@ ITEM_POTION_BOTTLE
Definition: Items.h:120
DrawSpellDescriptionPopup
void DrawSpellDescriptionPopup(int spell_index)
Definition: UIPopup.cpp:1372
pSkillPointsAttributeDescription
char * pSkillPointsAttributeDescription
Definition: mm7_data.cpp:670
pPlayerAgeAttributeDescription
char * pPlayerAgeAttributeDescription
Definition: mm7_data.cpp:657
GUIWindow::par1C
unsigned int par1C
Definition: GUIWindow.h:477
SpriteObject::sub_42F7EB_DropItemAt
static bool sub_42F7EB_DropItemAt(SPRITE_OBJECT_TYPE sprite, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9)
Definition: SpriteObject.cpp:937
GameUI_StatusBar_OnEvent
void GameUI_StatusBar_OnEvent(const String &str, unsigned int num_seconds)
Definition: UIStatusBar.cpp:33
Localization::GetNpcProfessionName
const char * GetNpcProfessionName(unsigned int index) const
Definition: Localization.h:83
ItemsTable::pEnchantments
ItemEnchantment pEnchantments[24]
Definition: Items.h:461
SPEECH_8
@ SPEECH_8
Definition: Player.h:54
WINDOW_CharacterWindow_Stats
@ WINDOW_CharacterWindow_Stats
Definition: GUIWindow.h:327
SpellInfo::pShortName
char * pShortName
Definition: Spells.h:177
GUIWindow::ptr_1C
void * ptr_1C
Definition: GUIWindow.h:476
pAttackBonusAttributeDescription
char * pAttackBonusAttributeDescription
Definition: mm7_data.cpp:660
EQUIP_GAUNTLETS
@ EQUIP_GAUNTLETS
Definition: Items.h:235
ITEM_ENCHANTMENT_OF_SPARKS
@ ITEM_ENCHANTMENT_OF_SPARKS
Definition: Items.h:44
ItemSpecialEnchantment::pBonusStatement
char * pBonusStatement
Definition: Items.h:431
ViewingParams::bRedrawGameUI
int bRedrawGameUI
Definition: Viewport.h:74
EQUIP_RING
@ EQUIP_RING
Definition: Items.h:237
PARTY_BUFF_DETECT_LIFE
@ PARTY_BUFF_DETECT_LIFE
Definition: Party.h:74
ACTOR_BUFF_SUMMONED
@ ACTOR_BUFF_SUMMONED
Definition: Actor.h:40
UI_OnMouseRightClick
void UI_OnMouseRightClick(int mouse_x, int mouse_y)
Definition: UIPopup.cpp:1459
pPlayerLevelAttributeDescription
char * pPlayerLevelAttributeDescription
Definition: mm7_data.cpp:658
Actor::uCurrentActionLength
uint16_t uCurrentActionLength
Definition: Actor.h:303
ITEM_POTION_CURE_INSANITY
@ ITEM_POTION_CURE_INSANITY
Definition: Items.h:130
MonsterInfo::pName
char * pName
Definition: Monsters.h:120
ItemGen::UpdateTempBonus
void UpdateTempBonus(GameTime time)
Definition: Items.cpp:146
ITEM_POTION_REJUVENATION
@ ITEM_POTION_REJUVENATION
Definition: Items.h:138
ACTOR_BUFF_STONESKIN
@ ACTOR_BUFF_STONESKIN
Definition: Actor.h:54
ACTOR_BUFF_BLESS
@ ACTOR_BUFF_BLESS
Definition: Actor.h:55
pWaterResistanceAttributeDescription
char * pWaterResistanceAttributeDescription
Definition: mm7_data.cpp:666
GUIWindow::uFrameX
unsigned int uFrameX
Definition: GUIWindow.h:468
pFireResistanceAttributeDescription
char * pFireResistanceAttributeDescription
Definition: mm7_data.cpp:664
GUIWindow::_41D73D_draw_buff_tooltip
void _41D73D_draw_buff_tooltip()
Definition: GUIWindow.cpp:235
GUIWindow::sHint
String sHint
Definition: GUIWindow.h:488
pAudioPlayer
AudioPlayer * pAudioPlayer
Definition: AudioPlayer.cpp:20
GameUI_CharacterQuickRecord_Draw
void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player)
Definition: UIGame.cpp:1057
Localization::GetClassName
const char * GetClassName(unsigned int index) const
Definition: Localization.h:35
SpellInfo::pDescription
char * pDescription
Definition: Spells.h:178
Condition_Eradicated
@ Condition_Eradicated
Definition: Conditions.h:24
Point
Definition: Point.h:3
ItemGen
Definition: Items.h:263
ItemGen::GetValue
unsigned int GetValue()
Definition: Items.cpp:588
ObjectList.h
pMessageQueue_50CBD0
struct GUIMessageQueue * pMessageQueue_50CBD0
Definition: GUIWindow.cpp:86
ITEM_POTION_MIGHT_BOOST
@ ITEM_POTION_MIGHT_BOOST
Definition: Items.h:131
PlayerSpeech
PlayerSpeech
Definition: Player.h:46
SPRITE_SPELL_FIRE_FIREBALL_IMPACT
@ SPRITE_SPELL_FIRE_FIREBALL_IMPACT
Definition: SpriteObject.h:49
ACTOR_BUFF_PAIN_HAMMERHANDS
@ ACTOR_BUFF_PAIN_HAMMERHANDS
Definition: Actor.h:59
ItemGen::m_enchantmentStrength
int m_enchantmentStrength
Definition: Items.h:328
Color16
uint16_t Color16(uint32_t r, uint32_t g, uint32_t b)
Definition: Engine.cpp:148
ITEM_REAGENT_CRUSHED_ROSE_PETALS
@ ITEM_REAGENT_CRUSHED_ROSE_PETALS
Definition: Items.h:101
pFontLucida
GUIFont * pFontLucida
Definition: GUIFont.cpp:19
_50C9A8_item_enchantment_timer
int _50C9A8_item_enchantment_timer
Definition: mm7_data.cpp:579
ACTOR_BUFF_BERSERK
@ ACTOR_BUFF_BERSERK
Definition: Actor.h:47
GetMapBookHintText
const char * GetMapBookHintText(int mouse_x, int mouse_y)
Definition: MapBook.cpp:337
ShowPopupShopItem
void ShowPopupShopItem()
Definition: UIShops.cpp:1344
ItemsTable::potion_data
unsigned __int16 potion_data[50][50]
Definition: Items.h:468
Actor::uCurrentActionAnimation
uint16_t uCurrentActionAnimation
Definition: Actor.h:308
pMouse
Mouse * pMouse
Definition: UIPopup.cpp:38
monster_popup_y_offsets
std::array< char, 88 > monster_popup_y_offsets
Definition: mm7_data.cpp:231
Actor::pMonsterInfo
struct MonsterInfo pMonsterInfo
Definition: Actor.h:292
SpellInfo::pBasicSkillDesc
char * pBasicSkillDesc
Definition: Spells.h:179
StringPrintf
String StringPrintf(const char *fmt,...)
Definition: Strings.cpp:9
Viewport::uViewportTL_X
int uViewportTL_X
Definition: Viewport.h:22
pAirResistanceAttributeDescription
char * pAirResistanceAttributeDescription
Definition: mm7_data.cpp:665
Party::sRotationY
int sRotationY
Definition: Party.h:251
VAR_AutoNotes
@ VAR_AutoNotes
Definition: Events.h:254
EQUIP_BOOTS
@ EQUIP_BOOTS
Definition: Items.h:236
String
std::string String
Definition: Strings.h:10
pChestWindow
GUIWindow * pChestWindow
Definition: GUIWindow.cpp:49
ITEM_DEVIL_ICHOR
@ ITEM_DEVIL_ICHOR
Definition: Items.h:114
pEventTimer
Timer * pEventTimer
Definition: Time.cpp:8
Sprites.h
GameTime
Definition: Time.h:14
Actor::DrawHealthBar
static void DrawHealthBar(Actor *actor, GUIWindow *window)
Definition: Actor.cpp:67
WINDOW_CharacterWindow_Skills
@ WINDOW_CharacterWindow_Skills
Definition: GUIWindow.h:328
ITEM_REAGENT_WIDOWSWEEP_BERRIES
@ ITEM_REAGENT_WIDOWSWEEP_BERRIES
Definition: Items.h:100
pEarthResistanceAttributeDescription
char * pEarthResistanceAttributeDescription
Definition: mm7_data.cpp:667
ITEM_REAGENT_PHILOSOPHERS_STONE
@ ITEM_REAGENT_PHILOSOPHERS_STONE
Definition: Items.h:119
ITEM_TROLL_RUBY
@ ITEM_TROLL_RUBY
Definition: Items.h:103
Mouse::RemoveHoldingItem
void RemoveHoldingItem()
Definition: Mouse.cpp:25
pObjectList
struct ObjectList * pObjectList
Definition: ObjectList.cpp:5
pFontSmallnum
GUIFont * pFontSmallnum
Definition: GUIFont.cpp:25
GameTime::FromSeconds
static GameTime FromSeconds(int seconds)
Definition: Time.h:83
ItemsTable::pItems
NZIArray< ItemDesc, 800 > pItems
Definition: Items.h:460
Mouse.h
SpellInfo::pGrandmasterSkillDesc
char * pGrandmasterSkillDesc
Definition: Spells.h:182
Localization::GetSkillDescriptionMaster
const char * GetSkillDescriptionMaster(unsigned int index) const
Definition: Localization.h:67
CURRENT_SCREEN::SCREEN_VIDEO
@ SCREEN_VIDEO
stat_string_coord
std::array< stat_coord, 26 > stat_string_coord
Definition: mm7_data.cpp:173
SpellInfo::pMasterSkillDesc
char * pMasterSkillDesc
Definition: Spells.h:181
GUIButton::uButtonType
int uButtonType
Definition: GUIButton.h:27
Vis.h
Time.h
SPEECH_7
@ SPEECH_7
Definition: Player.h:53
GameUI_GetMinimapHintText
String GameUI_GetMinimapHintText()
Definition: UIGame.cpp:1001
CURRENT_SCREEN::SCREEN_CHEST_INVENTORY
@ SCREEN_CHEST_INVENTORY
ACTOR_BUFF_ENSLAVED
@ ACTOR_BUFF_ENSLAVED
Definition: Actor.h:50
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52
ITEM_ARTIFACT_PUCK
@ ITEM_ARTIFACT_PUCK
Definition: Items.h:153