Mercurial > mm7
comparison UI/UIShops.cpp @ 2246:0be4f17b7986
shop stealing cleaned up a bit
author | Grumpy7 |
---|---|
date | Wed, 26 Feb 2014 01:14:18 +0100 |
parents | a9fa57fda3ae |
children | 8c5855b842dc |
comparison
equal
deleted
inserted
replaced
2241:9df0477a5e2b | 2246:0be4f17b7986 |
---|---|
1648 uNumSeconds = 0; | 1648 uNumSeconds = 0; |
1649 a3 = 0; | 1649 a3 = 0; |
1650 if ( pMapStats->GetMapInfo(pCurrentMapName) ) | 1650 if ( pMapStats->GetMapInfo(pCurrentMapName) ) |
1651 a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]._steal_perm; | 1651 a3 = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)]._steal_perm; |
1652 party_reputation = pParty->GetPartyReputation(); | 1652 party_reputation = pParty->GetPartyReputation(); |
1653 if (pPlayers[uActiveCharacter]->CanSteal()) | 1653 if ((!pPlayers[uActiveCharacter]->CanSteal() || !GetAsyncKeyState(VK_CONTROL)) && pParty->uNumGold < uPriceItemService) |
1654 { | 1654 { |
1655 if ( GetAsyncKeyState(VK_CONTROL) ) | 1655 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2); |
1656 { | 1656 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" |
1657 return; | |
1658 } | |
1659 if (pPlayers[uActiveCharacter]->CanSteal() && GetAsyncKeyState(VK_CONTROL)) | |
1660 { | |
1657 uNumSeconds = pPlayers[uActiveCharacter]->StealFromShop(bought_item, a3, party_reputation, 0, &a6); | 1661 uNumSeconds = pPlayers[uActiveCharacter]->StealFromShop(bought_item, a3, party_reputation, 0, &a6); |
1658 if ( !uNumSeconds ) | 1662 if ( !uNumSeconds ) |
1659 { | 1663 { |
1660 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, 0, a6); | 1664 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, 0, a6); |
1661 return; | 1665 return; |
1662 } | 1666 } |
1663 } | |
1664 } | |
1665 if ( pParty->uNumGold < uPriceItemService ) | |
1666 { | |
1667 if ( uNumSeconds != 2 ) | |
1668 { | |
1669 if ( uNumSeconds != 1 ) | |
1670 { | |
1671 PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)2); | |
1672 ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);// "You don't have enough gold" | |
1673 return; | |
1674 } | |
1675 } | |
1676 } | 1667 } |
1677 v39 = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID); | 1668 v39 = pPlayers[uActiveCharacter]->AddItem(-1, bought_item->uItemID); |
1678 if ( v39 ) | 1669 if ( v39 ) |
1679 { | 1670 { |
1680 bought_item->SetIdentified(); | 1671 bought_item->SetIdentified(); |
1681 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1], bought_item, sizeof(ItemGen)); | 1672 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1], bought_item, sizeof(ItemGen)); |
1682 if ( pPlayers[uActiveCharacter]->CanSteal() ) | 1673 if (uNumSeconds != 0) |
1683 { | 1674 { |
1684 if ( GetAsyncKeyState(VK_CONTROL) ) | 1675 pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1].SetStolen(); |
1685 { | 1676 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, uNumSeconds, a6); |
1686 if ( uNumSeconds == 1 || uNumSeconds == 2 ) | 1677 } |
1687 { | 1678 else |
1688 pPlayers[uActiveCharacter]->pInventoryItemList[v39 - 1].SetStolen(); | 1679 { |
1689 sub_4B1447_party_fine((int)window_SpeakInHouse->ptr_1C, uNumSeconds, a6); | 1680 dword_F8B1E4 = 1; |
1690 viewparams->bRedrawGameUI = 1; | 1681 Party::TakeGold(uPriceItemService); |
1691 bought_item->Reset(); | 1682 } |
1692 pRenderer->ClearZBuffer(0, 479); | |
1693 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0); | |
1694 return; | |
1695 } | |
1696 } | |
1697 } | |
1698 dword_F8B1E4 = 1; | |
1699 Party::TakeGold(uPriceItemService); | |
1700 viewparams->bRedrawGameUI = 1; | 1683 viewparams->bRedrawGameUI = 1; |
1701 bought_item->Reset(); | 1684 bought_item->Reset(); |
1702 pRenderer->ClearZBuffer(0, 479); | 1685 pRenderer->ClearZBuffer(0, 479); |
1703 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0); | 1686 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)SPEECH_75, 0); |
1704 return; | 1687 return; |
1705 } | 1688 } |
1706 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); | 1689 else |
1707 ShowStatusBarString(pGlobalTXT_LocalizationStrings[563], 2); // "Pack is Full!" | 1690 { |
1691 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); | |
1692 ShowStatusBarString(pGlobalTXT_LocalizationStrings[563], 2); // "Pack is Full!" | |
1693 return; | |
1694 } | |
1708 break; | 1695 break; |
1709 } | 1696 } |
1710 default:// if click video screen in shop | 1697 default:// if click video screen in shop |
1711 { | 1698 { |
1712 __debugbreak(); // please do record these dialogue ids to the HOUSE_DIALOGUE_MENU enum | 1699 __debugbreak(); // please do record these dialogue ids to the HOUSE_DIALOGUE_MENU enum |