Mercurial > might-and-magic-trilogy
changeset 159:494015e90b8b
Слияние
author | Ritor1 |
---|---|
date | Fri, 30 Nov 2012 09:40:51 +0600 |
parents | dcd8af594b02 (current diff) 9130272cdd48 (diff) |
children | 062e8a8e09bc |
files | |
diffstat | 1 files changed, 34 insertions(+), 44 deletions(-) [+] |
line wrap: on
line diff
--- a/mm7_4.cpp Fri Nov 30 09:40:45 2012 +0600 +++ b/mm7_4.cpp Fri Nov 30 09:40:51 2012 +0600 @@ -5870,7 +5870,7 @@ int v9; // edx@31 char *v10; // ebx@37 Player *v11; // esi@38 - signed int v12; // ecx@40 + signed int uSpellBookPageCount; // ecx@40 int v13; // eax@40 signed int v14; // eax@45 int v15; // eax@70 @@ -5995,31 +5995,26 @@ while ( (signed int)v1 < 32 ); item.Reset(); v10 = (char *)&pParty->pPlayers[0].sResMagicBase; - //do for ( pPlayer = &pParty->pPlayers[0]; (signed int)v10 < (signed int)((char *)&pParty->field_871C[455] + 2); pPlayer++) { v11 = pPlayer; - if ( !*(v10 - 5829) ) - *(short *)v10 = 10; + if ( !pPlayer->uClass ) + pPlayer->sResMagicBase = 10; *((short *)v10 + 400) = 0; - v12 = 0; - v13 = (int)(v10 - 5726); - while ( !*(short *)v13 ) - { - ++v12; - v13 += 2; - if ( v12 >= 9 ) - goto LABEL_45; - } - *(char *)(pPlayer->pNumSpellBookPage) = v12; -LABEL_45: + uSpellBookPageCount = 0; + for ( int i = 0; i < 9; i++) + { + if ( pPlayer->pActiveSkills[12+i] ) + ++uSpellBookPageCount; + } + pPlayer->pNumSpellBookPage = uSpellBookPageCount; pItemsTable->GenerateItem(2, 40, &item); pPlayer->AddItem2(0xFFFFFFFFu, &item); v14 = 0; v24.y = 0; do { - if ( *(short *)(v11 + 2 * v14 + 264) ) + if ( pPlayer->pActiveSkills[v14] ) { switch ( v14 ) { @@ -6057,32 +6052,32 @@ v18 = 76; goto LABEL_69; case 12: - pPlayer->AddItem(0xFFFFFFFFu, 0x191u); - *(char *)(v11 + 402) = 1; // pFireSpellBook + pPlayer->AddItem(-1, 0x191); + pPlayer->spellbook.pFireSpellbook.bIsSpellbookAvailable = 1; break; case 13: - pPlayer->AddItem(0xFFFFFFFFu, 0x19Cu); - *(char *)(v11 + 413) = 1; + pPlayer->AddItem(-1, 0x19C); + pPlayer->spellbook.pAirSpellbook.bIsSpellbookAvailable = 1; break; case 14: - pPlayer->AddItem(0xFFFFFFFFu, 0x1A7u); - *(char *)(v11 + 424) = 1; + pPlayer->AddItem(-1, 0x1A7); + pPlayer->spellbook.pWaterSpellbook.bIsSpellbookAvailable = 1; break; case 15: - pPlayer->AddItem(0xFFFFFFFFu, 0x1B2u); - *(char *)(v11 + 435) = 1; + pPlayer->AddItem(-1, 0x1B2); + pPlayer->spellbook.pEarthSpellbook.bIsSpellbookAvailable = 1; break; case 16: - pPlayer->AddItem(0xFFFFFFFFu, 0x1BDu); - *(char *)(v11 + 446) = 1; + pPlayer->AddItem(-1, 0x1BD); + pPlayer->spellbook.pSpiritSpellbook.bIsSpellbookAvailable = 1; break; case 17: - pPlayer->AddItem(0xFFFFFFFFu, 0x1C8u); - *(char *)(v11 + 457) = 1; + pPlayer->AddItem(-1, 0x1C8); + pPlayer->spellbook.pMindSpellbook.bIsSpellbookAvailable = 1; break; case 18: - pPlayer->AddItem(0xFFFFFFFFu, 0x1D3u); - *(char *)(v11 + 468) = 1; + pPlayer->AddItem(-1, 0x1D3); + pPlayer->spellbook.pBodySpellbook.bIsSpellbookAvailable = 1; break; case 21: case 23: @@ -6090,7 +6085,7 @@ case 26: case 29: case 36: - pPlayer->AddItem(0xFFFFFFFFu, 0xDCu); + pPlayer->AddItem(-1, 0xDC); v18 = 5 * (rand() % 3 + 40); goto LABEL_69; case 30: @@ -6099,23 +6094,18 @@ case 31: v18 = 110; LABEL_69: - pPlayer->AddItem(0xFFFFFFFFu, v18); + pPlayer->AddItem(-1, v18); break; default: break; } - v15 = (int)v11 + 552; - v16 = 138; - do - { - if ( *(int *)(v15 - 20) ) - *(int *)v15 |= 1u; - v15 += 36; - --v16; - } - while ( v16 ); - *(int *)(v11 + 6460) = pPlayer->GetMaxHealth(); - *(int *)(v11 + 6464) = pPlayer->GetMaxMana(); + for ( int i = 0; i < 138; i++) + { + if ( &pPlayer->pInventoryItems[i] ) + pPlayer->pInventoryItems[i].uAttributes |= 1; + } + pPlayer->sHealth = pPlayer->GetMaxHealth(); + pPlayer->sMana = pPlayer->GetMaxMana(); v14 = v24.y; } ++v14;