Mercurial > might-and-magic-trilogy
comparison mm7_4.cpp @ 23:509744251c8e
Player-related members
author | Nomad |
---|---|
date | Sun, 14 Oct 2012 00:27:38 +0200 |
parents | 540178ef9b18 |
children | 74940016abc8 |
comparison
equal
deleted
inserted
replaced
22:e7ee737cd473 | 23:509744251c8e |
---|---|
3628 v22 = (ITEM_EQUIP_TYPE)0; | 3628 v22 = (ITEM_EQUIP_TYPE)0; |
3629 while ( 1 ) | 3629 while ( 1 ) |
3630 { | 3630 { |
3631 if ( v21->HasItemEquipped(v22) ) | 3631 if ( v21->HasItemEquipped(v22) ) |
3632 { | 3632 { |
3633 v24 = *(int *)&v21->pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v23 + 5]; | 3633 v24 = *(int *)&v21->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v23 + 5]; |
3634 if ( v24 > 134 ) | 3634 if ( v24 > 134 ) |
3635 { | 3635 { |
3636 if ( v24 == 529 ) | 3636 if ( v24 == 529 ) |
3637 goto LABEL_43; | 3637 goto LABEL_43; |
3638 if ( v24 == 535 ) | 3638 if ( v24 == 535 ) |
5288 if ( a5 == 3 ) | 5288 if ( a5 == 3 ) |
5289 { | 5289 { |
5290 v35 = *v26; | 5290 v35 = *v26; |
5291 v36 = v13->GetValue(); | 5291 v36 = v13->GetValue(); |
5292 v29 = pPlayer->_4B8102(v36, v35); | 5292 v29 = pPlayer->_4B8102(v36, v35); |
5293 if ( v13->uAttributtes & 2 ) | 5293 if ( v13->uAttributes & 2 ) |
5294 { | 5294 { |
5295 LABEL_77: | 5295 LABEL_77: |
5296 v29 = 1; | 5296 v29 = 1; |
5297 goto LABEL_98; | 5297 goto LABEL_98; |
5298 } | 5298 } |
5311 if ( a5 == 6 ) | 5311 if ( a5 == 6 ) |
5312 { | 5312 { |
5313 v30 = *v26; | 5313 v30 = *v26; |
5314 v31 = v13->GetValue(); | 5314 v31 = v13->GetValue(); |
5315 v29 = pPlayer->_4B8102(v31, v30) / 2; | 5315 v29 = pPlayer->_4B8102(v31, v30) / 2; |
5316 if ( v13->uAttributtes & 2 ) | 5316 if ( v13->uAttributes & 2 ) |
5317 v29 = 1; | 5317 v29 = 1; |
5318 LABEL_91: | 5318 LABEL_91: |
5319 if ( v29 >= 1 ) | 5319 if ( v29 >= 1 ) |
5320 goto LABEL_98; | 5320 goto LABEL_98; |
5321 goto LABEL_77; | 5321 goto LABEL_77; |
5622 if ( v14 == 1 ) | 5622 if ( v14 == 1 ) |
5623 { | 5623 { |
5624 v15 = Str; | 5624 v15 = Str; |
5625 pGUIWindow_CurrentMenu->field_40 = 0; | 5625 pGUIWindow_CurrentMenu->field_40 = 0; |
5626 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 124u, 0, v15, 130, 0); | 5626 pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, v134, 124u, 0, v15, 130, 0); |
5627 SetCurrentMenuID(7u); | 5627 SetCurrentMenuID(MENU_7); |
5628 } | 5628 } |
5629 } | 5629 } |
5630 else | 5630 else |
5631 { | 5631 { |
5632 pGUIWindow_CurrentMenu->field_40 = 0; | 5632 pGUIWindow_CurrentMenu->field_40 = 0; |
6475 if (pAsyncMouse) | 6475 if (pAsyncMouse) |
6476 pAsyncMouse->Resume(); | 6476 pAsyncMouse->Resume(); |
6477 v2 = 6; | 6477 v2 = 6; |
6478 pGUIWindow_CurrentMenu->field_40 = 0; | 6478 pGUIWindow_CurrentMenu->field_40 = 0; |
6479 LABEL_27: | 6479 LABEL_27: |
6480 SetCurrentMenuID(v2); | 6480 SetCurrentMenuID((MENU_STATE)v2); |
6481 while ( GetCurrentMenuID() == MENU_CREATEPARTY ) | 6481 while ( GetCurrentMenuID() == MENU_CREATEPARTY ) |
6482 { | 6482 { |
6483 if ( pAsyncMouse != (void *)v1 ) | 6483 if ( pAsyncMouse != (void *)v1 ) |
6484 pAsyncMouse->_46B736_consume_click_lists(1); | 6484 pAsyncMouse->_46B736_consume_click_lists(1); |
6485 uMouseX = pMouse->GetCursorPos(&v24)->x; | 6485 uMouseX = pMouse->GetCursorPos(&v24)->x; |
6905 pRenderer->_4A5D33(a2, a3, 0, a5, &v21); | 6905 pRenderer->_4A5D33(a2, a3, 0, a5, &v21); |
6906 pRenderer->ResetClip(); | 6906 pRenderer->ResetClip(); |
6907 pRenderer->EndScene(); | 6907 pRenderer->EndScene(); |
6908 ++a5; | 6908 ++a5; |
6909 if ( a5 >= (signed __int16)v21.uHeight ) | 6909 if ( a5 >= (signed __int16)v21.uHeight ) |
6910 SetCurrentMenuID(0); | 6910 SetCurrentMenuID(MENU_MAIN); |
6911 timeGetTime(); | 6911 timeGetTime(); |
6912 pRenderer->Present(); | 6912 pRenderer->Present(); |
6913 GUI_MainMenuMessageProc(); | 6913 GUI_MainMenuMessageProc(); |
6914 } | 6914 } |
6915 } | 6915 } |
9905 v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos((POINT *)&v14)->y - 17) >> 5); | 9905 v18 = (v8 >> 5) + 14 * ((pMouse->GetCursorPos((POINT *)&v14)->y - 17) >> 5); |
9906 if ( pMouse->GetCursorPos((POINT *)&v13)->x <= 13 | 9906 if ( pMouse->GetCursorPos((POINT *)&v13)->x <= 13 |
9907 || pMouse->GetCursorPos((POINT *)&v12)->x >= 462 | 9907 || pMouse->GetCursorPos((POINT *)&v12)->x >= 462 |
9908 || (v9 = v0->GetItemIDAtInventoryIndex(&v18)) == 0 ) | 9908 || (v9 = v0->GetItemIDAtInventoryIndex(&v18)) == 0 ) |
9909 return; | 9909 return; |
9910 v7 = (ItemGen *)&v0->pDarkSpellbook.bIsSpellAvailable[36 * v9 + 5]; | 9910 v7 = (ItemGen *)&v0->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v9 + 5]; |
9911 LABEL_15: | 9911 LABEL_15: |
9912 GameUI_DrawItemInfo(v7); | 9912 GameUI_DrawItemInfo(v7); |
9913 return; | 9913 return; |
9914 } | 9914 } |
9915 if ( dword_F8B19C != 95 ) | 9915 if ( dword_F8B19C != 95 ) |
12996 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) ) | 12996 || (result *= 9, !(_this->field_1F5[4 * result + 15] & 2)) ) |
12997 return result; | 12997 return result; |
12998 v96 = 0; | 12998 v96 = 0; |
12999 v94 = 5; | 12999 v94 = 5; |
13000 v93 = ptr_507BC0->ptr_1C; | 13000 v93 = ptr_507BC0->ptr_1C; |
13001 v90 = (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[4 * result + 5]; | 13001 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5]; |
13002 v28 = (int)ptr_507BC0->ptr_1C; | 13002 v28 = (int)ptr_507BC0->ptr_1C; |
13003 uPlayerID = uActiveCharacter - 1; | 13003 uPlayerID = uActiveCharacter - 1; |
13004 v29 = _this->_490EEE((ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5); | 13004 v29 = _this->_490EEE((ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[4 * result + 5], 3, v28, 5); |
13005 v9 = uPlayerID; | 13005 v9 = uPlayerID; |
13006 v10 = (char *)pMerchantsRepairPhrases[v29]; | 13006 v10 = (char *)pMerchantsRepairPhrases[v29]; |
13007 goto LABEL_35; | 13007 goto LABEL_35; |
13008 } | 13008 } |
13009 if ( dword_F8B19C == 1 ) | 13009 if ( dword_F8B19C == 1 ) |
13086 v3 = 0; | 13086 v3 = 0; |
13087 if ( result ) | 13087 if ( result ) |
13088 { | 13088 { |
13089 v96 = 0; | 13089 v96 = 0; |
13090 v94 = 4; | 13090 v94 = 4; |
13091 v4 = &_this->pDarkSpellbook.bIsSpellAvailable[36 * result + 5]; | 13091 v4 = &_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * result + 5]; |
13092 if ( v4[20] & 1 ) | 13092 if ( v4[20] & 1 ) |
13093 { | 13093 { |
13094 v5 = sub_495461("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)ptr_507BC0->ptr_1C, 4, 0); | 13094 v5 = sub_495461("%24", uActiveCharacter - 1, (ItemGen *)v4, (char *)ptr_507BC0->ptr_1C, 4, 0); |
13095 v97 = 3; | 13095 v97 = 3; |
13096 v95 = v5; | 13096 v95 = v5; |
13126 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) | 13126 || (result = v0->GetItemIDAtInventoryIndex((int *)&v117), v3 = 0, !result) ) |
13127 return result; | 13127 return result; |
13128 v96 = 0; | 13128 v96 = 0; |
13129 v94 = 3; | 13129 v94 = 3; |
13130 v93 = ptr_507BC0->ptr_1C; | 13130 v93 = ptr_507BC0->ptr_1C; |
13131 v90 = (ItemGen *)&_this->pDarkSpellbook.bIsSpellAvailable[36 * result + 5]; | 13131 v90 = (ItemGen *)&_this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * result + 5]; |
13132 v12 = (int)ptr_507BC0->ptr_1C; | 13132 v12 = (int)ptr_507BC0->ptr_1C; |
13133 uPlayerID = uActiveCharacter - 1; | 13133 uPlayerID = uActiveCharacter - 1; |
13134 v13 = _this->_490EEE(v90, 3, v12, 3); | 13134 v13 = _this->_490EEE(v90, 3, v12, 3); |
13135 v9 = uPlayerID; | 13135 v9 = uPlayerID; |
13136 v10 = (char *)pMerchantsSellPhrases[v13]; | 13136 v10 = (char *)pMerchantsSellPhrases[v13]; |
13638 v3 = a1->uItemID; | 13638 v3 = a1->uItemID; |
13639 v4 = a1->uItemID; | 13639 v4 = a1->uItemID; |
13640 v5 = pItemsTable->pItems[v4].uEquipType; | 13640 v5 = pItemsTable->pItems[v4].uEquipType; |
13641 if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771) | 13641 if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771) |
13642 && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599) | 13642 && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599) |
13643 || BYTE1(a1->uAttributtes) & 1 ) | 13643 || BYTE1(a1->uAttributes) & 1 ) |
13644 return 0; | 13644 return 0; |
13645 v6 = v2 - 1; | 13645 v6 = v2 - 1; |
13646 if ( !v6 ) | 13646 if ( !v6 ) |
13647 { | 13647 { |
13648 v11 = __OFSUB__(v5, 2); | 13648 v11 = __OFSUB__(v5, 2); |
13931 v62 += v25; | 13931 v62 += v25; |
13932 ++v61; | 13932 ++v61; |
13933 } | 13933 } |
13934 else | 13934 else |
13935 { | 13935 { |
13936 if ( *(&byte_4ED94C[37 * v58->uClass] + v23) && !*(&v58->uIntelligence + v23) ) | 13936 __debugbreak(); |
13937 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] | |
13938 // or | |
13939 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] | |
13940 // or | |
13941 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] | |
13942 | |
13943 //if ( *(&byte_4ED94C[37 * v58->uClass] + v23) && !*(&v58->uIntelligence + v23) ) | |
13937 { | 13944 { |
13938 v24 = pFontArrus->CalcTextHeight(pClassNames[v23 + 20], &v52, 0, 0); | 13945 v24 = pFontArrus->CalcTextHeight(pClassNames[v23 + 20], &v52, 0, 0); |
13939 v62 += v24; | 13946 v62 += v24; |
13940 ++v61; | 13947 ++v61; |
13941 ++Str; | 13948 ++Str; |
13979 v27 = v20->GetControl(v62); | 13986 v27 = v20->GetControl(v62); |
13980 v28 = v27; | 13987 v28 = v27; |
13981 v29 = v27->uControlParam; | 13988 v29 = v27->uControlParam; |
13982 if ( v29 == 18 ) | 13989 if ( v29 == 18 ) |
13983 break; | 13990 break; |
13984 if ( *(&byte_4ED94C[37 * v58->uClass] + v29) && !*(&v58->uIntelligence + v29) ) | 13991 |
13992 __debugbreak(); | |
13993 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] | |
13994 // or | |
13995 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] | |
13996 // or | |
13997 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] | |
13998 | |
13999 //if ( *(&byte_4ED94C[37 * v58->uClass] + v29) && !*(&v58->uIntelligence + v29) ) | |
13985 { | 14000 { |
13986 v30 = pClassNames[v29 + 20]; | 14001 v30 = pClassNames[v29 + 20]; |
13987 LABEL_55: | 14002 LABEL_55: |
13988 Str = v30; | 14003 Str = v30; |
13989 v28->uY = v63 + v55; | 14004 v28->uY = v63 + v55; |
14557 if ( dword_F8B19C != 1 ) | 14572 if ( dword_F8B19C != 1 ) |
14558 { | 14573 { |
14559 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) | 14574 if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) |
14560 { | 14575 { |
14561 v5 = 0; | 14576 v5 = 0; |
14562 if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) | 14577 |
14578 __debugbreak(); | |
14579 //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] | |
14580 // or | |
14581 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] | |
14582 // or | |
14583 //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] | |
14584 | |
14585 if (false | |
14586 //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) | |
14563 || (v6 = (int)(&v1->uIntelligence + dword_F8B19C), *(short *)v6) ) | 14587 || (v6 = (int)(&v1->uIntelligence + dword_F8B19C), *(short *)v6) ) |
14564 { | 14588 { |
14565 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | 14589 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); |
14566 } | 14590 } |
14567 else | 14591 else |