World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Файл UIGuilds.h

См. исходные тексты.

Функции

void SpellBookGenerator ()
 

Функции

◆ SpellBookGenerator()

void SpellBookGenerator ( )

См. определение в файле UIGuilds.cpp строка 298

298  { // for GuildDialogs
299  int pItemNum; // esi@1
300  int randomnum; // esi@7
301 
302  for (int i = 0; i < 12; ++i) {
303  if (p2DEvents[window_SpeakInHouse->par1C - 1].uType >= 5) {
304  if (p2DEvents[window_SpeakInHouse->par1C - 1].uType <= 13) {
305  pItemNum =
306  rand() %
307  word_4F0F30[(signed int)window_SpeakInHouse->par1C -
308  139] +
309  11 *
310  p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1]
311  .uType +
312  345;
313  } else {
314  if (p2DEvents[window_SpeakInHouse->par1C - 1].uType == 14)
315  randomnum = rand() % 4;
316  else if (p2DEvents[window_SpeakInHouse->par1C - 1].uType == 15)
317  randomnum = rand() % 3 + 4;
318  else if (p2DEvents[window_SpeakInHouse->par1C - 1].uType == 16)
319  randomnum = rand() % 2 + 7;
320  if (p2DEvents[window_SpeakInHouse->par1C - 1].uType <= 16)
321  pItemNum =
322  rand() %
323  word_4F0F30[(signed int)window_SpeakInHouse->par1C -
324  139] +
325  11 * randomnum + 400;
326  }
327  }
328 
329  if (pItemNum == 487) { // divine intervention check
330  if (!(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 239))
331  pItemNum = 486;
332  }
333 
334  ItemGen *item_spellbook =
336  item_spellbook->Reset();
338  .uItemID = pItemNum;
340  .IsIdentified();
341 
343  pItemsTable->pItems[pItemNum].pIconName, 0x7FF);
344  }
345 }

Перекрестные ссылки _449B57_test_bit(), Party::_quest_bits, assets, AssetsManager::GetImage_ColorKey(), p2DEvents, GUIWindow::par1C, ItemsTable::pItems, pItemsTable, pParty, GUIWindow::ptr_1C, ItemGen::Reset(), shop_ui_items_in_store, Party::SpellBooksInGuilds, _2devent::uType, window_SpeakInHouse и word_4F0F30.

+ Граф вызовов:
_2devent::uType
BuildingType uType
Definition: Events2D.h:41
_449B57_test_bit
bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
Definition: Party.cpp:1185
Party::_quest_bits
unsigned __int8 _quest_bits[64]
Definition: Party.h:291
ItemGen::Reset
void Reset()
Definition: Items.cpp:133
p2DEvents
_2devent p2DEvents[525]
Definition: Events.cpp:57
pItemsTable
struct ItemsTable * pItemsTable
Definition: Items.cpp:37
window_SpeakInHouse
GUIWindow * window_SpeakInHouse
Definition: GUIWindow.cpp:51
pParty
Party * pParty
Definition: Party.cpp:30
word_4F0F30
std::array< int16_t, 32 > word_4F0F30
Definition: mm7_data.cpp:496
AssetsManager::GetImage_ColorKey
Texture * GetImage_ColorKey(const String &name, uint16_t colorkey)
Definition: AssetsManager.cpp:34
shop_ui_items_in_store
std::array< Image *, 12 > shop_ui_items_in_store
Definition: UIShops.cpp:35
assets
AssetsManager * assets
Definition: AssetsManager.cpp:12
GUIWindow::par1C
unsigned int par1C
Definition: GUIWindow.h:477
GUIWindow::ptr_1C
void * ptr_1C
Definition: GUIWindow.h:476
ItemGen
Definition: Items.h:263
Party::SpellBooksInGuilds
std::array< std::array< ItemGen, 12 >, 32 > SpellBooksInGuilds
Definition: Party.h:316
ItemsTable::pItems
NZIArray< ItemDesc, 800 > pItems
Definition: Items.h:460