Mercurial > might-and-magic-trilogy
comparison mm7_1.cpp @ 23:509744251c8e
Player-related members
author | Nomad |
---|---|
date | Sun, 14 Oct 2012 00:27:38 +0200 |
parents | 540178ef9b18 |
children | 93bf1d5f6a6d |
comparison
equal
deleted
inserted
replaced
22:e7ee737cd473 | 23:509744251c8e |
---|---|
863 v14 = v7->uTextureHeight; | 863 v14 = v7->uTextureHeight; |
864 LOBYTE(v13) = v13 & 0xE0; | 864 LOBYTE(v13) = v13 & 0xE0; |
865 v15 = v13 + 32; | 865 v15 = v13 + 32; |
866 if ( v9 < 14 ) | 866 if ( v9 < 14 ) |
867 v14 = 14; | 867 v14 = 14; |
868 v16 = v5->uAttributtes; | 868 v16 = v5->uAttributes; |
869 v17 = a2a + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[a3 + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; | 869 v17 = a2a + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[a3 + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; |
870 if ( !(v16 & 0xF0) ) | 870 if ( !(v16 & 0xF0) ) |
871 { | 871 { |
872 if ( v16 & 1 | 872 if ( v16 & 1 |
873 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 13 ) | 873 || uGame_if_0_else_ui_id__11_save__else_load__8_drawSpellInfoPopup__22_final_window__26_keymapOptions__2_options__28_videoOptions != 13 ) |
902 v18 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; | 902 v18 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; |
903 dword_50C9A8 -= pEventTimer->uTimeElapsed; | 903 dword_50C9A8 -= pEventTimer->uTimeElapsed; |
904 if ( dword_50C9A8 <= 0 ) | 904 if ( dword_50C9A8 <= 0 ) |
905 { | 905 { |
906 dword_50C9A8 = 0; | 906 dword_50C9A8 = 0; |
907 LOBYTE(v25->uAttributtes) &= 0xFu; | 907 LOBYTE(v25->uAttributes) &= 0xFu; |
908 ptr_50C9A4 = 0; | 908 ptr_50C9A4 = 0; |
909 } | 909 } |
910 v19 = (double)GetTickCount() * 0.1; | 910 v19 = (double)GetTickCount() * 0.1; |
911 pRenderer->_4A63E6(a2a, a3, v7, v18, (signed __int64)v19, 0, 255); | 911 pRenderer->_4A63E6(a2a, a3, v7, v18, (signed __int64)v19, 0, 255); |
912 LABEL_33: | 912 LABEL_33: |
1178 pPlayer->uSkillPoints != 0 ? v46 : 0, | 1178 pPlayer->uSkillPoints != 0 ? v46 : 0, |
1179 pTmpBuf, | 1179 pTmpBuf, |
1180 84, | 1180 84, |
1181 0); | 1181 0); |
1182 v32 = v45 + v31; | 1182 v32 = v45 + v31; |
1183 v48 = pPlayer->GetMajorConditionrIdx(); | 1183 v48 = pPlayer->GetMajorConditionIdx(); |
1184 if ( !v43 ) | 1184 if ( !v43 ) |
1185 pGUIWindow_CurrentMenu->DrawTextInRect( | 1185 pGUIWindow_CurrentMenu->DrawTextInRect( |
1186 pFontArrus, | 1186 pFontArrus, |
1187 0x16u, | 1187 0x16u, |
1188 v32, | 1188 v32, |
2534 v81 = 0; | 2534 v81 = 0; |
2535 else | 2535 else |
2536 v81 >>= 1; | 2536 v81 >>= 1; |
2537 v8 = _this; | 2537 v8 = _this; |
2538 if ( !v3[46] ) | 2538 if ( !v3[46] ) |
2539 _this->uAttributtes |= 1u; | 2539 _this->uAttributes |= 1u; |
2540 v9 = v8->uAttributtes; | 2540 v9 = v8->uAttributes; |
2541 v77 = 0; | 2541 v77 = 0; |
2542 a2.y = v9 & 2; | 2542 a2.y = v9 & 2; |
2543 if ( pItemsTable->pItems[v8->uItemID].uEquipType == 18 ) | 2543 if ( pItemsTable->pItems[v8->uItemID].uEquipType == 18 ) |
2544 v77 = v8->uAdditionalValue; | 2544 v77 = v8->uAdditionalValue; |
2545 if ( uActiveCharacter ) | 2545 if ( uActiveCharacter ) |
2547 if ( !(v9 & 1) ) | 2547 if ( !(v9 & 1) ) |
2548 { | 2548 { |
2549 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; | 2549 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; |
2550 v11 = _this; | 2550 v11 = _this; |
2551 if ( v10 ) | 2551 if ( v10 ) |
2552 _this->uAttributtes |= 1u; | 2552 _this->uAttributes |= 1u; |
2553 v10 = (v11->uAttributtes & 1) == 0; | 2553 v10 = (v11->uAttributes & 1) == 0; |
2554 v83 = (char *)9; | 2554 v83 = (char *)9; |
2555 if ( v10 ) | 2555 if ( v10 ) |
2556 { | 2556 { |
2557 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); | 2557 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); |
2558 } | 2558 } |
2572 if ( a2.y ) | 2572 if ( a2.y ) |
2573 { | 2573 { |
2574 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; | 2574 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; |
2575 v12 = _this; | 2575 v12 = _this; |
2576 if ( v10 ) | 2576 if ( v10 ) |
2577 _this->uAttributtes = _this->uAttributtes & 0xFFFFFFFD | 1; | 2577 _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1; |
2578 v10 = (v12->uAttributtes & 2) == 0; | 2578 v10 = (v12->uAttributes & 2) == 0; |
2579 v83 = (char *)11; | 2579 v83 = (char *)11; |
2580 if ( v10 ) | 2580 if ( v10 ) |
2581 v83 = (char *)10; | 2581 v83 = (char *)10; |
2582 else | 2582 else |
2583 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); | 2583 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); |
2586 pPlayers[uActiveCharacter]->PlaySound((int)v83, 0); | 2586 pPlayers[uActiveCharacter]->PlaySound((int)v83, 0); |
2587 dword_4E455C = 0; | 2587 dword_4E455C = 0; |
2588 } | 2588 } |
2589 } | 2589 } |
2590 } | 2590 } |
2591 v13 = _this->uAttributtes; | 2591 v13 = _this->uAttributes; |
2592 v14 = _this->uAttributtes & 1; | 2592 v14 = _this->uAttributes & 1; |
2593 a2.y = _this->uAttributtes & 1; | 2593 a2.y = _this->uAttributes & 1; |
2594 if ( v13 & 2 ) | 2594 if ( v13 & 2 ) |
2595 { | 2595 { |
2596 v79._415551(0); | 2596 v79._415551(0); |
2597 //v15 = &; | 2597 //v15 = &; |
2598 pRenderer->Clip( | 2598 pRenderer->Clip( |
2723 Str += v29; | 2723 Str += v29; |
2724 } | 2724 } |
2725 v79.uFrameHeight = v73->uTextureHeight + v81 + 54; | 2725 v79.uFrameHeight = v73->uTextureHeight + v81 + 54; |
2726 if ( (signed int)Str > (signed int)v79.uFrameHeight ) | 2726 if ( (signed int)Str > (signed int)v79.uFrameHeight ) |
2727 v79.uFrameHeight = (unsigned int)Str; | 2727 v79.uFrameHeight = (unsigned int)Str; |
2728 if ( _this->uAttributtes & 8 && (_this->uAdditionalValue || _this->_bonus_type) ) | 2728 if ( _this->uAttributes & 8 && (_this->uAdditionalValue || _this->_bonus_type) ) |
2729 v79.uFrameHeight += LOBYTE(v82->uFontHeight); | 2729 v79.uFrameHeight += LOBYTE(v82->uFontHeight); |
2730 v83 = 0; | 2730 v83 = 0; |
2731 if ( LOBYTE(pFontArrus->uFontHeight) ) | 2731 if ( LOBYTE(pFontArrus->uFontHeight) ) |
2732 { | 2732 { |
2733 v79.uFrameWidth -= 24; | 2733 v79.uFrameWidth -= 24; |
2793 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); | 2793 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); |
2794 v41 = 100; | 2794 v41 = 100; |
2795 } | 2795 } |
2796 else | 2796 else |
2797 { | 2797 { |
2798 if ( _this->uAttributtes & 8 && (_this->uAdditionalValue || _this->_bonus_type) ) | 2798 if ( _this->uAttributes & 8 && (_this->uAdditionalValue || _this->_bonus_type) ) |
2799 { | 2799 { |
2800 sub_493F79((stru351 *)&v67, _this->uExpireTime - pParty->uTimePlayed); | 2800 sub_493F79((stru351 *)&v67, _this->uExpireTime - pParty->uTimePlayed); |
2801 strcpy(pTmpBuf, "Duration:"); | 2801 strcpy(pTmpBuf, "Duration:"); |
2802 Str = (char *)(v72 - 1168); | 2802 Str = (char *)(v72 - 1168); |
2803 if ( v72 != 1168 ) | 2803 if ( v72 != 1168 ) |
2817 v79.DrawText(v82, 100, v79.uFrameHeight - 2 * LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | 2817 v79.DrawText(v82, 100, v79.uFrameHeight - 2 * LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); |
2818 } | 2818 } |
2819 v37 = _this->GetValue(); | 2819 v37 = _this->GetValue(); |
2820 sprintfex(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); | 2820 sprintfex(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); |
2821 v79.DrawText(v82, 100, v79.uFrameHeight - LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | 2821 v79.DrawText(v82, 100, v79.uFrameHeight - LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); |
2822 v38 = _this->uAttributtes; | 2822 v38 = _this->uAttributes; |
2823 if ( BYTE1(v38) & 1 ) | 2823 if ( BYTE1(v38) & 1 ) |
2824 { | 2824 { |
2825 v61 = 0; | 2825 v61 = 0; |
2826 v56 = 0; | 2826 v56 = 0; |
2827 v51 = 0; | 2827 v51 = 0; |
4377 while ( v1 < uChestArea ); | 4377 while ( v1 < uChestArea ); |
4378 } | 4378 } |
4379 v11 = 0; | 4379 v11 = 0; |
4380 if ( uChestArea > 0 ) | 4380 if ( uChestArea > 0 ) |
4381 { | 4381 { |
4382 v12 = &pChests[v3].mm7__vector_pItems[0].uAttributtes; | 4382 v12 = &pChests[v3].mm7__vector_pItems[0].uAttributes; |
4383 do | 4383 do |
4384 { | 4384 { |
4385 v9 = *(v12 - 5); | 4385 v9 = *(v12 - 5); |
4386 if ( v9 ) | 4386 if ( v9 ) |
4387 { | 4387 { |
5169 if ( (signed int)pY < 350 ) | 5169 if ( (signed int)pY < 350 ) |
5170 { | 5170 { |
5171 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | 5171 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; |
5172 if ( v14 == zero || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | 5172 if ( v14 == zero || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) |
5173 goto _return; | 5173 goto _return; |
5174 v15 = (ItemGen *)&pPlayers[uActiveCharacter]->pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5]; | 5174 v15 = (ItemGen *)&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v14 + 5]; |
5175 goto LABEL_49; | 5175 goto LABEL_49; |
5176 } | 5176 } |
5177 _click_on_game_ui: | 5177 _click_on_game_ui: |
5178 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | 5178 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX |
5179 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | 5179 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ |
5526 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0); | 5526 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0); |
5527 v11 = areWeLoadingTexture; | 5527 v11 = areWeLoadingTexture; |
5528 if ( uActiveCharacter | 5528 if ( uActiveCharacter |
5529 && (v2 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) != 0 ) | 5529 && (v2 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) != 0 ) |
5530 { | 5530 { |
5531 memcpy(&pPlayers[uActiveCharacter]->pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5], &pParty->pPickedItem, 0x24u); | 5531 memcpy(&pPlayers[uActiveCharacter]->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5], &pParty->pPickedItem, 0x24u); |
5532 } | 5532 } |
5533 else | 5533 else |
5534 { | 5534 { |
5535 v12 = 0; | 5535 v12 = 0; |
5536 v3 = pParty->pPlayers; | 5536 v3 = pParty->pPlayers; |
5542 ++v12; | 5542 ++v12; |
5543 ++v3; | 5543 ++v3; |
5544 if ( (signed int)v3 >= (signed int)pParty->pHirelings ) | 5544 if ( (signed int)v3 >= (signed int)pParty->pHirelings ) |
5545 goto LABEL_10; | 5545 goto LABEL_10; |
5546 } | 5546 } |
5547 memcpy(&pParty->pPlayers[v12].pDarkSpellbook.bIsSpellAvailable[36 * v4 + 5], &pParty->pPickedItem, 0x24u); | 5547 memcpy(&pParty->pPlayers[v12].spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v4 + 5], &pParty->pPickedItem, 0x24u); |
5548 pMouse->RemoveHoldingItem(); | 5548 pMouse->RemoveHoldingItem(); |
5549 LABEL_10: | 5549 LABEL_10: |
5550 if ( v12 != 4 ) | 5550 if ( v12 != 4 ) |
5551 goto LABEL_18; | 5551 goto LABEL_18; |
5552 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | 5552 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; |
5610 { | 5610 { |
5611 v2 = pPlayers[uPlayerID]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID); | 5611 v2 = pPlayers[uPlayerID]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID); |
5612 v3 = pPlayers[v1]; | 5612 v3 = pPlayers[v1]; |
5613 if ( v2 ) | 5613 if ( v2 ) |
5614 { | 5614 { |
5615 memcpy(&v3->pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5], &pParty->pPickedItem, 0x24u); | 5615 memcpy(&v3->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v2 + 5], &pParty->pPickedItem, 0x24u); |
5616 viewparams->bRedrawGameUI = 1; | 5616 viewparams->bRedrawGameUI = 1; |
5617 pMouse->RemoveHoldingItem(); | 5617 pMouse->RemoveHoldingItem(); |
5618 return; | 5618 return; |
5619 } | 5619 } |
5620 if ( v3->CanAct() ) | 5620 if ( v3->CanAct() ) |
5735 { | 5735 { |
5736 *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu; | 5736 *((char *)ptr_507BD4->ptr_1C + 8) &= 0x7Fu; |
5737 *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1; | 5737 *((short *)ptr_507BD4->ptr_1C + 2) = uActiveCharacter - 1; |
5738 *((int *)ptr_507BD4->ptr_1C + 3) = v6 - 1; | 5738 *((int *)ptr_507BD4->ptr_1C + 3) = v6 - 1; |
5739 *((short *)ptr_507BD4->ptr_1C + 3) = a4; | 5739 *((short *)ptr_507BD4->ptr_1C + 3) = a4; |
5740 ptr_50C9A4 = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v6 + 5]; | 5740 ptr_50C9A4 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v6 + 5]; |
5741 unk_50C9A0 = 0; | 5741 unk_50C9A0 = 0; |
5742 if ( pMessageQueue_50CBD0->uNumMessages ) | 5742 if ( pMessageQueue_50CBD0->uNumMessages ) |
5743 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 5743 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
5744 pMouse->SetCursorBitmap("MICON1"); | 5744 pMouse->SetCursorBitmap("MICON1"); |
5745 dword_50C9D0 = 113; | 5745 dword_50C9D0 = 113; |
5754 v8 = v0->GetItemIDAtInventoryIndex(&a4); | 5754 v8 = v0->GetItemIDAtInventoryIndex(&a4); |
5755 if ( !v7 ) | 5755 if ( !v7 ) |
5756 { | 5756 { |
5757 if ( !v8 ) | 5757 if ( !v8 ) |
5758 return; | 5758 return; |
5759 memcpy(&pParty->pPickedItem, &v0->pDarkSpellbook.bIsSpellAvailable[36 * v8 + 5], sizeof(pParty->pPickedItem)); | 5759 memcpy(&pParty->pPickedItem, &v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v8 + 5], sizeof(pParty->pPickedItem)); |
5760 v0->RemoveItemAtInventoryIndex(a4); | 5760 v0->RemoveItemAtInventoryIndex(a4); |
5761 v9 = pParty->pPickedItem.uItemID; | 5761 v9 = pParty->pPickedItem.uItemID; |
5762 goto LABEL_24; | 5762 goto LABEL_24; |
5763 } | 5763 } |
5764 v13 = v8; | 5764 v13 = v8; |
5765 if ( v8 ) | 5765 if ( v8 ) |
5766 { | 5766 { |
5767 a2.y = (LONG)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v8 + 5]; | 5767 a2.y = (LONG)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v8 + 5]; |
5768 memcpy(&this_, (const void *)a2.y, sizeof(this_)); | 5768 memcpy(&this_, (const void *)a2.y, sizeof(this_)); |
5769 v0->RemoveItemAtInventoryIndex(a4); | 5769 v0->RemoveItemAtInventoryIndex(a4); |
5770 pX = v0->AddItem2(a4, &pParty->pPickedItem); | 5770 pX = v0->AddItem2(a4, &pParty->pPickedItem); |
5771 if ( !pX ) | 5771 if ( !pX ) |
5772 { | 5772 { |
5786 } | 5786 } |
5787 v10 = v0->AddItem(a4, v7); | 5787 v10 = v0->AddItem(a4, v7); |
5788 pX = v10; | 5788 pX = v10; |
5789 if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) | 5789 if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) |
5790 { | 5790 { |
5791 memcpy(&v0->pDarkSpellbook.bIsSpellAvailable[36 * v10 + 5], &pParty->pPickedItem, 0x24u); | 5791 memcpy(&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v10 + 5], &pParty->pPickedItem, 0x24u); |
5792 pMouse->RemoveHoldingItem(); | 5792 pMouse->RemoveHoldingItem(); |
5793 } | 5793 } |
5794 } | 5794 } |
5795 | 5795 |
5796 | 5796 |