Mercurial > mm7
comparison Player.cpp @ 223:1bd823f52e3a
Merge
author | Gloval |
---|---|
date | Sun, 17 Feb 2013 11:41:44 +0400 |
parents | 8113753ed2ae 0c64754c7fd4 |
children | c879446b4a22 0df4136b6aac 0191c3a3271c |
comparison
equal
deleted
inserted
replaced
222:8113753ed2ae | 223:1bd823f52e3a |
---|---|
574 void Player::PlaySound(PlayerSpeech speech, int a3) | 574 void Player::PlaySound(PlayerSpeech speech, int a3) |
575 { | 575 { |
576 //Player *pPlayer; // edi@1 | 576 //Player *pPlayer; // edi@1 |
577 //int v4; // eax@4 | 577 //int v4; // eax@4 |
578 signed int v5; // esi@4 | 578 signed int v5; // esi@4 |
579 char *v6; // ebx@4 | 579 unsigned char *v6; // ebx@4 |
580 signed int v7; // ecx@5 | 580 signed int v7; // ecx@5 |
581 unsigned __int8 v8; // al@6 | 581 unsigned __int8 v8; // al@6 |
582 int v9; // eax@10 | 582 int v9; // eax@10 |
583 //unsigned int pVoiceID; // ecx@10 | 583 //unsigned int pVoiceID; // ecx@10 |
584 int v11; // esi@10 | 584 int v11; // esi@10 |
606 } | 606 } |
607 | 607 |
608 //v4 = a2;//102 | 608 //v4 = a2;//102 |
609 v5 = 0; | 609 v5 = 0; |
610 pSoundId = 0; | 610 pSoundId = 0; |
611 v6 = (char *)&SoundSetAction[4 * speech];//byte_4ED280 &byte_4ED3D8[4 * v4] ??? | 611 v6 = SoundSetAction[speech];//byte_4ED280 &byte_4ED3D8[4 * v4] ??? |
612 if ( uVoicesVolumeMultiplier ) | 612 if (uVoicesVolumeMultiplier) |
613 { | 613 { |
614 v7 = 0; | 614 v7 = 0; |
615 do | 615 do |
616 { | 616 { |
617 v8 = v6[v7]; | 617 v8 = v6[v7]; |
623 if ( v5 ) | 623 if ( v5 ) |
624 { | 624 { |
625 v9 = rand(); | 625 v9 = rand(); |
626 //pVoiceID = uVoiceID; | 626 //pVoiceID = uVoiceID; |
627 v11 = v20[v9 % v5]; | 627 v11 = v20[v9 % v5]; |
628 if ( LOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[uVoiceID]) ) | 628 |
629 { | 629 if (int _v1 = byte_4ECF08[v11 - 1][uVoiceID]) |
630 pSoundId = rand() % SLOBYTE((&(&dlhu_texnames_by_face[19])[25 * v11 + 3])[uVoiceID]) | 630 { |
631 + 2 * (v11 + 50 * uVoiceID) | 631 pSoundId = rand() % _v1 + 2 * (v11 + 50 * uVoiceID) + 4998; |
632 + 4998; | 632 v12 = (8 * pPlayerNum + 312) | OBJECT_Player; |
633 v12 = 8 * pPlayerNum + 312; | |
634 LOBYTE(v12) = v12 | OBJECT_Player; | |
635 pAudioPlayer->PlaySound((SoundID)pSoundId, v12, 0, -1, 0, 0, (pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0), 0); | 633 pAudioPlayer->PlaySound((SoundID)pSoundId, v12, 0, -1, 0, 0, (pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0), 0); |
636 } | 634 } |
637 } | 635 } |
638 } | 636 } |
637 | |
639 v13 = 0; | 638 v13 = 0; |
640 v14 = (int)(v6 + 3); | 639 v14 = (int)(v6 + 3); |
641 do | 640 do |
642 { | 641 { |
643 if ( *(char *)v14 ) | 642 if ( *(char *)v14 ) |
1372 Player *v11; // [sp+Ch] [bp-4h]@1 | 1371 Player *v11; // [sp+Ch] [bp-4h]@1 |
1373 unsigned int uItemIDa; // [sp+1Ch] [bp+Ch]@1 | 1372 unsigned int uItemIDa; // [sp+1Ch] [bp+Ch]@1 |
1374 | 1373 |
1375 v11 = this; | 1374 v11 = this; |
1376 v3 = pIcons_LOD->LoadTexture(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); | 1375 v3 = pIcons_LOD->LoadTexture(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1377 v4 = (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0); | 1376 v4 = (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0); |
1378 v5 = GetSizeInInventorySlots(v3 != -1 ? pIcons_LOD->pTextures[v3].uTextureWidth : 24); | 1377 v5 = GetSizeInInventorySlots(v3 != -1 ? pIcons_LOD->pTextures[v3].uTextureWidth : 24); |
1379 uItemIDa = GetSizeInInventorySlots(v4->uTextureHeight); | 1378 uItemIDa = GetSizeInInventorySlots(v4->uTextureHeight); |
1380 if ( !areWeLoadingTexture ) | 1379 if ( !areWeLoadingTexture ) |
1381 { | 1380 { |
1382 v4->Release(); | 1381 v4->Release(); |
1461 v12 = v3; | 1460 v12 = v3; |
1462 LABEL_5: | 1461 LABEL_5: |
1463 if ( v12 == -1 ) | 1462 if ( v12 == -1 ) |
1464 { | 1463 { |
1465 if ( uActiveCharacter ) | 1464 if ( uActiveCharacter ) |
1466 pPlayers[uActiveCharacter]->PlaySound(SPEECH_15, 0); | 1465 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); |
1467 result = 0; | 1466 result = 0; |
1468 } | 1467 } |
1469 else | 1468 else |
1470 { | 1469 { |
1471 v6 = uItemID; | 1470 v6 = uItemID; |
1759 unsigned int v8; // ebp@1 | 1758 unsigned int v8; // ebp@1 |
1760 void *v9; // edx@4 | 1759 void *v9; // edx@4 |
1761 unsigned int uSlota; // [sp+14h] [bp+4h]@1 | 1760 unsigned int uSlota; // [sp+14h] [bp+4h]@1 |
1762 | 1761 |
1763 pIndices = &this->pInventoryIndices[uSlot]; | 1762 pIndices = &this->pInventoryIndices[uSlot]; |
1763 | |
1764 __debugbreak(); // the following indexing is invalid | |
1764 v3 = (ItemGen *)&this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *pIndices + 5]; | 1765 v3 = (ItemGen *)&this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *pIndices + 5]; |
1765 v4 = v3->uItemID; | 1766 v4 = v3->uItemID; |
1766 v3->Reset(); | 1767 v3->Reset(); |
1767 v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v4].pIconName, TEXTURE_16BIT_PALETTE); | 1768 v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v4].pIconName, TEXTURE_16BIT_PALETTE); |
1768 v6 = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); | 1769 v6 = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); |
2313 field_F4 = 0; | 2314 field_F4 = 0; |
2314 field_F8 = 0; | 2315 field_F8 = 0; |
2315 field_FC = 0; | 2316 field_FC = 0; |
2316 field_100 = 0; | 2317 field_100 = 0; |
2317 field_104 = 0; | 2318 field_104 = 0; |
2319 | |
2320 lastOpenedSpellbookPage = 0; | |
2318 } | 2321 } |
2319 | 2322 |
2320 //----- (0048C6F6) -------------------------------------------------------- | 2323 //----- (0048C6F6) -------------------------------------------------------- |
2321 bool Party::AddItem(ItemGen *pItem) | 2324 bool Party::AddItem(ItemGen *pItem) |
2322 { | 2325 { |
6532 | 6535 |
6533 pActiveSkills[i] = 1; | 6536 pActiveSkills[i] = 1; |
6534 | 6537 |
6535 switch (i) | 6538 switch (i) |
6536 { | 6539 { |
6537 case PLAYER_SKILL_FIRE: spellbook.pFireSpellbook.bIsSpellbookAvailable = true; break; | 6540 case PLAYER_SKILL_FIRE: spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; break; |
6538 case PLAYER_SKILL_AIR: spellbook.pAirSpellbook.bIsSpellbookAvailable = true; break; | 6541 case PLAYER_SKILL_AIR: spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; break; |
6539 case PLAYER_SKILL_WATER: spellbook.pWaterSpellbook.bIsSpellbookAvailable = true; break; | 6542 case PLAYER_SKILL_WATER: spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; break; |
6540 case PLAYER_SKILL_EARTH: spellbook.pEarthSpellbook.bIsSpellbookAvailable = true; break; | 6543 case PLAYER_SKILL_EARTH: spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; break; |
6541 case PLAYER_SKILL_SPIRIT: spellbook.pSpiritSpellbook.bIsSpellbookAvailable = true; break; | 6544 case PLAYER_SKILL_SPIRIT: spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; break; |
6542 case PLAYER_SKILL_MIND: spellbook.pMindSpellbook.bIsSpellbookAvailable = 1; break; | 6545 case PLAYER_SKILL_MIND: spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; break; |
6543 case PLAYER_SKILL_BODY: spellbook.pBodySpellbook.bIsSpellbookAvailable = 1; break; | 6546 case PLAYER_SKILL_BODY: spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; break; |
6544 case PLAYER_SKILL_LIGHT: spellbook.pLightSpellbook.bIsSpellbookAvailable = 1; break; | 6547 case PLAYER_SKILL_LIGHT: spellbook.pLightSpellbook.bIsSpellAvailable[0] = true; break; |
6545 case PLAYER_SKILL_DARK: spellbook.pDarkSpellbook.bIsSpellbookAvailable = 1; break; | 6548 case PLAYER_SKILL_DARK: spellbook.pDarkSpellbook.bIsSpellAvailable[0] = true; break; |
6546 } | 6549 } |
6547 } | 6550 } |
6548 | 6551 |
6549 sHealth = GetMaxHealth(); | 6552 sHealth = GetMaxHealth(); |
6550 sMana = GetMaxMana(); | 6553 sMana = GetMaxMana(); |