World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
|
См. документацию. 1 #define _CRTDBG_MAP_ALLOC
4 #define _CRT_SECURE_NO_WARNINGS
44 int all_text_height = 0;
45 for (
int i = 0; i < 4; ++i)
49 int textspacings = (174 - all_text_height) / 4;
50 int textoffset = 138 - (textspacings / 2);
57 i < pDialogueWindow->pNumPresenceButton +
61 pButton->
uY = textspacings + textoffset;
64 textoffset = pButton->
uY +
68 pButton->
uW = textoffset + 6;
70 pColorText =
Color16(0xE1u, 0xCDu, 0x23u);
72 pColorText =
Color16(0xFFu, 0xFFu, 0xFFu);
97 int all_text_height = 0;
98 for (
int i = 0; i < options; ++i)
102 int textspacings = (174 - all_text_height) / options;
103 int textoffset = 138 - (textspacings / 2);
110 i < pDialogueWindow->pNumPresenceButton +
114 pButton->
uY = textspacings + textoffset;
117 textoffset = pButton->
uY +
121 pButton->
uW = textoffset + 6;
123 pColorText =
Color16(0xE1u, 0xCDu, 0x23u);
125 pColorText =
Color16(0xFFu, 0xFFu, 0xFFu);
141 int invindex = ((pt.
x - 14) / 32) + 14 * ((pt.
y - 17) / 32);
142 if (pt.
x <= 13 || pt.
x >= 462)
160 Color16(0xFFu, 0xFFu, 0xFFu), str, 3);
174 int invindex = ((pt.
x - 14) >> 5) + 14 * ((pt.
y - 17) >> 5);
175 if (pt.
x <= 13 || pt.
x >= 462)
return;
196 Color16(0xFFu, 0xFFu, 0xFFu), str, 3);
210 int invindex = ((pt.
x - 14) >> 5) + 14 * ((pt.
y - 17) >> 5);
211 if (pt.
x <= 13 || pt.
x >= 462)
228 Color16(0xFFu, 0xFFu, 0xFFu), str, 3);
236 int all_text_height = 0;
240 if (pPrice < baseprice / 3)
241 pPrice = baseprice / 3;
244 i < pDialogueWindow->pNumPresenceButton +
264 int textspacings = (149 - all_text_height) / item_num;
265 if (textspacings > 32)
268 int textoffset = 162 - textspacings / 2;
274 i < pDialogueWindow->pNumPresenceButton +
283 ->pActiveSkills[pButton->
msg_param - 36]) {
288 pButton->
uY = textspacings + textoffset;
298 pButton->
uW = textoffset + 6;
299 pColorText =
Color16(0xE1u, 0xCDu, 0x23u);
301 pColorText =
Color16(0xFFu, 0xFFu, 0xFFu);
323 Color16(0xE1u, 0xCDu, 0x23u), str, 3);
331 for (
uint i = 0; i < 6; ++i) {
334 ->StandartItemsInShops[(
unsigned int)
342 render->DrawTextureAlphaNew(
355 for (
uint i = 0; i < 6; ++i) {
358 ->StandartItemsInShops[(
unsigned int)
383 int testx = (pt.
x - 30) / 70;
384 if (testx >= 0 && testx < 6) {
398 if (pt.
x >= testpos &&
423 Color16(0xFFu, 0xFFu, 0xFFu), str, 3);
487 for (
int i = 0; i < 8; ++i) {
495 render->DrawTextureAlphaNew(
501 render->DrawTextureAlphaNew(
514 for (
int i = 0; i < 8; ++i) {
535 int testx = (pt.
x - 40) / 105;
537 if (testx >= 0 && testx < 4) {
554 (testx * 105) - 420);
561 if (pt.
x >= testpos &&
588 Color16(0xFFu, 0xFFu, 0xFFu), str, 3);
655 for (
uint i = 0; i < 12; ++i) {
664 if (itemy < 0) itemy = 0;
671 if (itemy < 0) itemy = 0;
676 if (i == 0 || i == 6) {
677 if (itemx < 18) itemx = 18;
680 if (i == 5 || i == 11) {
685 render->DrawTextureAlphaNew(itemx / 640.0
f, itemy / 480.0
f,
693 for (
uint i = 0; i < 12; ++i) {
715 int testx = (pt.
x) / 75;
717 if (testx >= 0 && testx < 6) {
737 if (pt.
x >= testpos &&
751 ->SelectPhrasesTransaction(
770 Color16(0xFFu, 0xFFu, 0xFFu), str, 3);
875 unsigned int pItemID;
879 float pPriceMultiplier;
882 int party_reputation;
886 unsigned __int16 *pSkill;
890 unsigned int uNumSeconds;
891 unsigned int invindex;
892 int uPriceItemService;
914 int testx = (pt.
x - 32) / 70;
915 if (testx >= 0 && testx < 6) {
924 testpos = 32 + 70 * testx - 420;
926 testpos = 32 + 70 * testx;
929 if (pt.
x >= testpos &&
938 bought_item->
GetValue(), pPriceMultiplier);
958 bought_item->
Reset();
959 render->ClearZBuffer(0, 479);
978 invindex = ((pt.
x - 14) >> 5) + 14 * ((pt.
y - 17) >> 5);
979 if (pt.
x <= 13 || pt.
x >= 462 ||
985 ->pInventoryItemList[pItemID - 1]
991 render->ClearZBuffer(0, 479);
1002 invindex = ((pt.
x - 14) >> 5) + 14 * ((pt.
y - 17) >> 5);
1003 if (pt.
x <= 13 || pt.
x >= 462 ||
1039 invindex = ((pt.
x - 14) >> 5) + 14 * ((pt.
y - 17) >> 5);
1040 if (pt.
x <= 13 || pt.
x >= 462 ||
1051 item->
GetValue(), pPriceMultiplier);
1087 testx = (pt.
x - 30) / 70;
1088 if (testx >= 0 && testx < 6) {
1105 if (pt.
x >= testpos &&
1117 bought_item =
nullptr;
1128 testx = (pt.
x - 40) / 105;
1129 if (testx >= 0 && testx < 4) {
1148 (testx * 105) - 420);
1156 if (pt.
x >= testpos &&
1171 bought_item =
nullptr;
1183 testx = (pt.
x) / 75;
1184 if (testx >= 0 && testx < 6) {
1213 if (pt.
x >= testpos &&
1229 bought_item =
nullptr;
1254 bought_item, a3, party_reputation, 0, &a6);
1270 bought_item,
sizeof(
ItemGen));
1271 if (uNumSeconds != 0) {
1273 ->pInventoryItemList[v39 - 1]
1282 bought_item->
Reset();
1283 render->ClearZBuffer(0, 479);
1305 (
signed __int64)(
p2DEvents[(
unsigned int)
1313 if (uPriceItemService < v43 / 3) uPriceItemService = v43 / 3;
1360 testx = (pt.
x - 30) / 70;
1361 if (testx >= 0 && testx < 6) {
1377 if (pt.
x >= testpos &&
1399 testx = (pt.
x - 40) / 105;
1400 if (testx >= 0 && testx < 4) {
1419 (testx * 105) - 420);
1427 if (pt.
x >= testpos &&
1452 testx = (pt.
x) / 75;
1454 if (testx >= 0 && testx < 6) {
1483 if (pt.
x >= testpos &&
1524 invindex = ((pt.
x - 14) >> 5) + 14 * ((pt.
y - 17) >> 5);
1525 if (pt.
x <= 13 || pt.
x >= 462 ||
1538 int testx = (pt.
x - 32) / 70;
1539 if (testx >= 0 && testx < 6) {
1550 testpos = 32 + 70 * testx - 420;
1552 testpos = 32 + 70 * testx;
1555 if (pt.
x >= testpos &&
1566 unsigned int guildId =
1582 unsigned __int16 v8;
1586 int spellId = spellItemId - 399;
1587 int spellLevel = (spellItemId - 400) % 11 + 1;
1588 unsigned int spellSchool = 4 * (spellItemId - 400) / 11;
1594 unsigned int v3 = 30;
1611 if (v14 > a2.
y) v5 = v14;
1612 if (v13 > v5) v5 = v13;
1613 if (v4 > v5) v5 = v4;
1616 "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%"
1617 "s\t000\n%s\t%03d:\t%03d%s",
1639 v8 =
Color16(0xFFu, 0xFFu, 0x9Bu);
1648 *(&
pSpellDatas[0].uNormalLevelMana + 10 * spellId));
1681 for (
uint i = 1; i <= 4; ++i) {
1682 if (
pPlayers[i]->CanAct()) v7[v5++] = i;
1694 for (
uint i = 1; i <= 4; ++i) {
1714 if (stealingResult == 0 || stealingResult == 1) {
1724 for (
uint i = 1; i <= 4; ++i) {
1729 if (stealingResult == 1)
std::array< const char *, 7 > pMerchantsIdentifyPhrases
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)
void ShopDialogIdentify(GUIWindow dialogwin, BuildingType building)
const char * GetString(unsigned int index) const
GameTime & GetPlayingTime()
void UIShop_Buy_Identify_Repair()
@ HOUSE_DIALOGUE_SHOP_BUY_SPECIAL
void AlchemyMagicShopWares(GUIWindow dialogwin, BuildingType building, bool special)
Image * shop_ui_background
bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2)
std::array< GameTime, 85 > Shops_next_generation_time
HOUSE_DIALOGUE_MENU dialog_menu_id
enum PlayerSpeech PlayerSpeechID
MAP_TYPE GetMapInfo(const String &Str2)
void PlaySound(SoundID eSoundID, int pid, unsigned int uNumRepeats, int x, int y, int a7)
std::array< int, 53 > InTheShopFlags
unsigned int game_viewport_width
std::array< int16_t, 6 > weapons_Ypos
@ HOUSE_DIALOGUE_LEARN_SKILLS
Localization * localization
void GameUI_StatusBar_DrawImmediate(const String &str, int color)
void DrawTitleText(GUIFont *font, int horizontal_margin, int vertical_margin, unsigned __int16 uDefaultColor, const char *pInString, int line_spacing)
unsigned int GetLineWidth(const String &str)
unsigned int GetHeight() const
NZIArray< struct Player *, 5 > pPlayers
const char * GetSkillName(unsigned int index) const
enum CURRENT_SCREEN current_screen_type
PartyTimeStruct PartyTimes
struct MapStats * pMapStats
int pStartingPosActiveItem
void CharacterUI_InventoryTab_Draw(Player *player, bool a2)
std::array< const char *, 4 > pShopOptions
enum WindowType current_character_screen_window
BuildingType in_current_building_type
@ BuildingType_WeaponShop
void ShopDialogSellEquip(GUIWindow dialogwin, BuildingType building)
GUIWindow * window_SpeakInHouse
int pCurrentPosActiveItem
@ HOUSE_DIALOGUE_GUILD_BUY_BOOKS
@ WINDOW_CharacterWindow_Inventory
void ShopDialogLearn(GUIWindow dialogwin)
struct ViewingParams * viewparams
void GetHouseGoodbyeSpeech()
void DrawMessageBox(bool inside_game_viewport)
std::array< SpellData, 100 > pSpellDatas
unsigned int uFrameHeight
void ShopDialogMain(GUIWindow dialogwin)
static Mouse * ResolveMouse()
struct DDM_DLV_Header dlv
static void TakeGold(int amount)
unsigned int CalcTextHeight(const String &str, unsigned int width, int x_offset, bool return_on_carriage=false)
std::array< const char *, 7 > pMerchantsSellPhrases
std::array< Image *, 12 > shop_ui_items_in_store
void sub_4B1523_showSpellbookInfo(int spellItemId)
void PlayHouseSound(unsigned int uHouseID, HouseSoundID sound)
std::array< std::array< ItemGen, 12 >, 53 > StandartItemsInShops
struct SpellStats * pSpellStats
struct DDM_DLV_Header ddm
bool HouseUI_CheckIfPlayerCanInteract()
String BuildDialogueString(const char *lpsz, unsigned __int8 uPlayerID, ItemGen *a3, char *a4, int a5, GameTime *a6)
@ HOUSE_DIALOGUE_SHOP_SELL
void ArmorShopWares(GUIWindow dialogwin, bool special)
void GameUI_DrawItemInfo(struct ItemGen *inspect_item)
@ BuildingType_AlchemistShop
GLfloat GLfloat GLfloat v2
unsigned int uActiveCharacter
GLfloat GLfloat GLfloat GLfloat v3
String FormatString(unsigned int index,...) const
void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle)
void __cdecl __debugbreak(void)
void GameUI_StatusBar_OnEvent(const String &str, unsigned int num_seconds)
std::array< GameTime, 53 > _shop_ban_times
static GameTime FromDays(int days)
void DrawShops_next_generation_time_string(GameTime time)
LEVEL_TYPE uCurrentlyLoadedLevelType
std::array< const char *, 7 > pMerchantsBuyPhrases
@ HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT
GUIButton * GetControl(unsigned int uID)
std::array< const char *, 7 > pMerchantsRepairPhrases
@ HOUSE_DIALOGUE_SHOP_BUY_STANDARD
AudioPlayer * pAudioPlayer
const char * GetClassName(unsigned int index) const
void sub_4B1447_party_fine(int shopId, int stealingResult, int fineToAdd)
@ HOUSE_DIALOGUE_SHOP_REPAIR
GUIWindow * pDialogueWindow
uint16_t Color16(uint32_t r, uint32_t g, uint32_t b)
OutdoorLocation * pOutdoor
void ShopDialogDisplayEquip(GUIWindow dialogwin, BuildingType building=BuildingType_WeaponShop)
void WeaponShopWares(GUIWindow dialogwin, bool special)
void ShopDialogRepair(GUIWindow dialogwin, BuildingType building)
int64_t _A750D8_player_speech_timer
std::array< std::array< ItemGen, 12 >, 32 > SpellBooksInGuilds
String StringPrintf(const char *fmt,...)
std::array< std::array< ItemGen, 12 >, 53 > SpecialItemsInShops
@ HOUSE_DIALOGUE_SHOP_IDENTIFY
std::array< std::array< char, 37 >, 36 > byte_4ED970_skill_learn_ability_by_class_table
char * pGrandmasterSkillDesc
bool MerchandiseTest(int _2da_idx)
std::shared_ptr< IRender > render