comparison Player.cpp @ 1819:1641ab7f21ec

Player::SubtractVariable moving everything to one switch
author Grumpy7
date Tue, 08 Oct 2013 05:46:44 +0200
parents 253194aba8b8
children af7f08135ffb
comparison
equal deleted inserted replaced
1818:253194aba8b8 1819:1641ab7f21ec
6617 v4 = 1; 6617 v4 = 1;
6618 else if ( this == pPlayers[3] ) 6618 else if ( this == pPlayers[3] )
6619 v4 = 2; 6619 v4 = 2;
6620 else if ( this == pPlayers[4] ) 6620 else if ( this == pPlayers[4] )
6621 v4 = 3; 6621 v4 = 3;
6622 6622
6623 v3 = 0; 6623
6624 result = false; 6624
6625 if ( VarNum >= VAR_AutoNotes ) 6625
6626 { 6626 if ( VarNum >= VAR_MapPersistentVariable_0 && VarNum <= VAR_MapPersistentVariable_99 )
6627 if ( VarNum <= VAR_NumDeaths ) 6627 {
6628 { 6628
6629 if ( VarNum == VAR_NumDeaths ) 6629 byte_5E4C15[VarNum] -= (char)pValue;
6630 { 6630 return false;
6631 }
6632
6633 switch (VarNum)
6634 {
6635 case VAR_NumDeaths:
6631 pParty->uNumDeaths -= (unsigned int)pValue; 6636 pParty->uNumDeaths -= (unsigned int)pValue;
6632 return pValue; 6637 return pValue;
6633 } 6638 case VAR_AutoNotes:
6634 if ( VarNum == VAR_AutoNotes ) 6639 v11 = (char *)pParty->_autonote_bits;
6635 { 6640 v22 = (short)pValue - 1;
6636 v11 = (char *)pParty->_autonote_bits;
6637 v22 = (short)pValue - 1;
6638 }
6639 else
6640 {
6641 if ( VarNum != VAR_PlayerBits )
6642 {
6643 switch ( VarNum )
6644 {
6645 case VAR_NPCs2:
6646 v18 = 0;
6647 GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &v18);
6648 result = (bool) pValue;
6649 if ( v18 == pValue )
6650 {
6651 npcIdToDismissAfterDialogue = pValue;
6652 }
6653 else
6654 {
6655 npcIdToDismissAfterDialogue = 0;
6656 pParty->hirelingScrollPosition = 0;
6657 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu;
6658 pParty->CountHirelings();
6659 viewparams->bRedrawGameUI = true;
6660 }
6661 break;
6662 case VAR_HiredNPCHasSpeciality:
6663 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
6664 {
6665 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
6666 for ( v19 = 0; v19 < (signed int)pNPCStats->uNumNewNPCs; ++v19 )
6667 {
6668 if ( *((void **)v20 + 4) == (void *)pValue )
6669 {
6670 v21 = *(int *)v20;
6671 if ( (char)*(int *)v20 < 0 )
6672 {
6673 LOBYTE(v21) = v21 & 0x7F;
6674 *(int *)v20 = v21;
6675 }
6676 }
6677 v20 += 76;
6678 }
6679 }
6680 if ( pParty->pHirelings[0].uProfession == pValue )
6681 memset(pParty->pHirelings, 0, 0x4Cu);
6682 if ( pParty->pHirelings[1].uProfession == pValue )
6683 memset(&pParty->pHirelings[1], 0, 0x4Cu);
6684 pParty->hirelingScrollPosition = 0;
6685 pParty->CountHirelings();
6686 break;
6687 case VAR_NumSkillPoints:
6688 v17 = (char *)&this->uSkillPoints;
6689 result = *v17 != NULL;
6690 if ( (unsigned int)pValue <= *(int *)v17 )
6691 {
6692 *(int *)v17 -= (int)pValue;
6693 result = (v17 != NULL);
6694 }
6695 else
6696 *(int *)v17 = 0;
6697 break;
6698 case VAR_ReputationInCurrentLocation:
6699 v16 = (char *)&pOutdoor->ddm;
6700 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
6701 v16 = (char *)&pIndoor->dlv;
6702 *((int *)v16 + 2) -= (int)pValue;
6703 if ( *((int *)v16 + 2) < -10000 )
6704 *((int *)v16 + 2) = -10000;
6705 break;
6706 case VAR_GoldInBank:
6707 result = VarNum - 306;
6708 if ( (unsigned int)pValue <= pParty->uNumGoldInBank )
6709 {
6710 result = (bool)pValue;
6711 pParty->uNumGoldInBank -= (unsigned int)pValue;
6712 }
6713 else
6714 LABEL_88:
6715 dword_5B65C4 = 1;
6716 break;
6717 }
6718 return result;
6719 }
6720 v11 = this->field_1A50;
6721 v22 = (signed __int16)pValue;
6722 }
6723 _449B7E_toggle_bit((unsigned char *)v11, v22, 0); 6641 _449B7E_toggle_bit((unsigned char *)v11, v22, 0);
6724 return result; 6642 return result;
6725 } 6643
6726 switch ( VarNum ) 6644 case VAR_NPCs2:
6727 { 6645 v18 = 0;
6728 case VAR_NumBounties: 6646 GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &v18);
6729 result = (bool)pValue; 6647 result = (bool) pValue;
6730 pParty->uNumBountiesCollected -= (unsigned int)pValue; 6648 if ( v18 == pValue )
6731 break; 6649 {
6732 case VAR_PrisonTerms: 6650 npcIdToDismissAfterDialogue = pValue;
6733 result = (bool)pValue; 6651 }
6734 pParty->uNumPrisonTerms -= (int)pValue; 6652 else
6735 break; 6653 {
6736 case VAR_ArenaWinsPage: 6654 npcIdToDismissAfterDialogue = 0;
6737 result = (bool)pValue; 6655 pParty->hirelingScrollPosition = 0;
6738 pParty->uNumArenaPageWins -= (char)pValue; 6656 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu;
6739 break; 6657 pParty->CountHirelings();
6740 case VAR_ArenaWinsSquire: 6658 viewparams->bRedrawGameUI = true;
6741 result = (bool)pValue; 6659 }
6742 pParty->uNumArenaSquireWins -= (char)pValue; 6660 return result;
6743 break; 6661 break;
6744 case VAR_ArenaWinsKnight: 6662 case VAR_HiredNPCHasSpeciality:
6745 result = (bool)pValue; 6663 if ( (signed int)pNPCStats->uNumNewNPCs > 0 )
6746 pParty->uNumArenaKnightWins -= (char)pValue; 6664 {
6747 break; 6665 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags;
6748 case VAR_ArenaWinsLord: 6666 for ( v19 = 0; v19 < (signed int)pNPCStats->uNumNewNPCs; ++v19 )
6749 result = (bool)pValue; 6667 {
6750 pParty->uNumArenaLordWins -= (char)pValue; 6668 if ( *((void **)v20 + 4) == (void *)pValue )
6751 break; 6669 {
6752 } 6670 v21 = *(int *)v20;
6753 Error("Function not returning any value! (%u)", VarNum); 6671 if ( (char)*(int *)v20 < 0 )
6754 } 6672 {
6755 else 6673 LOBYTE(v21) = v21 & 0x7F;
6756 { 6674 *(int *)v20 = v21;
6757 if ( VarNum >= VAR_MapPersistentVariable_0 ) 6675 }
6758 { 6676 }
6759 byte_5E4C15[VarNum] -= (char)pValue; 6677 v20 += 76;
6760 } 6678 }
6761 else 6679 }
6762 { 6680 if ( pParty->pHirelings[0].uProfession == pValue )
6763 switch ( VarNum ) 6681 memset(pParty->pHirelings, 0, 0x4Cu);
6764 { 6682 if ( pParty->pHirelings[1].uProfession == pValue )
6765 case VAR_RandomGold: 6683 memset(&pParty->pHirelings[1], 0, 0x4Cu);
6766 v6 = rand() % (signed int)pValue + 1; 6684 pParty->hirelingScrollPosition = 0;
6767 if ( v6 > pParty->uNumGold ) 6685 pParty->CountHirelings();
6768 v6 = pParty->uNumGold; 6686 return result;
6769 Party::TakeGold(v6); 6687 break;
6770 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], v6); 6688
6771 ShowStatusBarString(pTmpBuf.data(), 2); 6689 case VAR_NumSkillPoints:
6772 GameUI_DrawFoodAndGold(); 6690 v17 = (char *)&this->uSkillPoints;
6773 return result; 6691 result = *v17 != NULL;
6774 case VAR_RandomFood: 6692 if ( (unsigned int)pValue <= *(int *)v17 )
6775 v7 = rand() % (signed int)pValue + 1; 6693 {
6776 if ( v7 > pParty->uNumFoodRations ) 6694 *(int *)v17 -= (int)pValue;
6777 v7 = pParty->uNumFoodRations; 6695 result = (v17 != NULL);
6778 Party::TakeFood(v7); 6696 }
6779 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], v7); 6697 else
6780 ShowStatusBarString(pTmpBuf.data(), 2u); 6698 *(int *)v17 = 0;
6781 GameUI_DrawFoodAndGold(); 6699 return result;
6782 PlayAwardSound_Anim98(v4); 6700 break;
6783 return result; 6701 case VAR_ReputationInCurrentLocation:
6784 case VAR_CurrentHP: 6702 v16 = (char *)&pOutdoor->ddm;
6785 ReceiveDamage((signed int)pValue, DMGT_PHISYCAL); 6703 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor )
6786 PlayAwardSound_Anim98(v4); 6704 v16 = (char *)&pIndoor->dlv;
6787 return result; 6705 *((int *)v16 + 2) -= (int)pValue;
6788 case VAR_CurrentSP: 6706 if ( *((int *)v16 + 2) < -10000 )
6789 this->sMana = max(this->sMana - pValue, 0); 6707 *((int *)v16 + 2) = -10000;
6790 PlayAwardSound_Anim98(v4); 6708 return result;
6791 return result; 6709 break;
6792 case VAR_ACModifier: 6710 case VAR_GoldInBank:
6793 this->sACModifier -= (unsigned __int8)pValue; 6711 result = VarNum - 306;
6794 PlayAwardSound_Anim98(v4); 6712 if ( (unsigned int)pValue <= pParty->uNumGoldInBank )
6795 return result; 6713 {
6796 case VAR_BaseLevel: 6714 result = (bool)pValue;
6797 this->uLevel -= (unsigned __int8)pValue; 6715 pParty->uNumGoldInBank -= (unsigned int)pValue;
6798 PlayAwardSound_Anim98(v4); 6716 }
6799 return result; 6717 else
6800 case VAR_LevelModifier: 6718 {
6801 this->sLevelModifier -= (unsigned __int8)pValue; 6719 dword_5B65C4 = 1;
6802 PlayAwardSound_Anim98(v4); 6720 }
6803 return result; 6721 return result;
6804 case VAR_Age: 6722 break;
6805 this->sAgeModifier -= (signed __int16)pValue; 6723
6806 return result; 6724
6807 case VAR_Award: 6725 case VAR_NumBounties:
6808 _449B7E_toggle_bit(this->_achieved_awards_bits, (signed __int16)pValue, 0); 6726 result = (bool)pValue;
6809 return result; 6727 pParty->uNumBountiesCollected -= (unsigned int)pValue;
6810 case VAR_Experience: 6728 break;
6811 this->uExperience -= pValue; 6729 case VAR_PrisonTerms:
6812 PlayAwardSound_Anim98(v4); 6730 result = (bool)pValue;
6813 return result; 6731 pParty->uNumPrisonTerms -= (int)pValue;
6814 case VAR_QBits_QuestsDone: 6732 break;
6815 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0); 6733 case VAR_ArenaWinsPage:
6816 this->PlaySound(SPEECH_96, 0); 6734 result = (bool)pValue;
6817 return true; 6735 pParty->uNumArenaPageWins -= (char)pValue;
6818 case VAR_PlayerItemInHands: 6736 break;
6819 v15 = this->pInventoryMatrix; 6737 case VAR_ArenaWinsSquire:
6820 break; 6738 result = (bool)pValue;
6821 case VAR_FixedGold: 6739 pParty->uNumArenaSquireWins -= (char)pValue;
6822 if ( (unsigned int)pValue > pParty->uNumGold ) 6740 break;
6823 goto LABEL_88; 6741 case VAR_ArenaWinsKnight:
6824 Party::TakeGold((unsigned int)pValue); 6742 result = (bool)pValue;
6825 return result; 6743 pParty->uNumArenaKnightWins -= (char)pValue;
6826 case VAR_MightBonus: 6744 break;
6827 case VAR_ActualMight: 6745 case VAR_ArenaWinsLord:
6828 this->uMightBonus -= (unsigned __int16)pValue; 6746 result = (bool)pValue;
6829 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91); 6747 pParty->uNumArenaLordWins -= (char)pValue;
6830 return result; 6748 break;
6831 case VAR_IntellectBonus: 6749
6832 case VAR_ActualIntellect: 6750
6833 this->uIntelligenceBonus -= (unsigned __int16)pValue; 6751 case VAR_RandomGold:
6834 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91); 6752 v6 = rand() % (signed int)pValue + 1;
6835 return result; 6753 if ( v6 > pParty->uNumGold )
6836 case VAR_PersonalityBonus: 6754 v6 = pParty->uNumGold;
6837 case VAR_ActualPersonality: 6755 Party::TakeGold(v6);
6838 this->uWillpowerBonus -= (unsigned __int16)pValue; 6756 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], v6);
6839 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91); 6757 ShowStatusBarString(pTmpBuf.data(), 2);
6840 return result; 6758 GameUI_DrawFoodAndGold();
6841 case VAR_EnduranceBonus: 6759 return result;
6842 case VAR_ActualEndurance: 6760 case VAR_RandomFood:
6843 this->uEnduranceBonus -= (unsigned __int16)pValue; 6761 v7 = rand() % (signed int)pValue + 1;
6844 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91); 6762 if ( v7 > pParty->uNumFoodRations )
6845 return result; 6763 v7 = pParty->uNumFoodRations;
6846 case VAR_SpeedBonus: 6764 Party::TakeFood(v7);
6847 case VAR_ActualSpeed: 6765 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], v7);
6848 this->uSpeedBonus -= (unsigned __int16)pValue; 6766 ShowStatusBarString(pTmpBuf.data(), 2u);
6849 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91); 6767 GameUI_DrawFoodAndGold();
6850 return result; 6768 PlayAwardSound_Anim98(v4);
6851 case VAR_AccuracyBonus: 6769 return result;
6852 case VAR_ActualAccuracy: 6770 case VAR_CurrentHP:
6853 this->uAccuracyBonus -= (unsigned __int16)pValue; 6771 ReceiveDamage((signed int)pValue, DMGT_PHISYCAL);
6854 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91); 6772 PlayAwardSound_Anim98(v4);
6855 return result; 6773 return result;
6856 case VAR_LuckBonus: 6774 case VAR_CurrentSP:
6857 case VAR_ActualLuck: 6775 this->sMana = max(this->sMana - pValue, 0);
6858 this->uLuckBonus -= (unsigned __int16)pValue; 6776 PlayAwardSound_Anim98(v4);
6859 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91); 6777 return result;
6860 return result; 6778 case VAR_ACModifier:
6861 case VAR_BaseMight: 6779 this->sACModifier -= (unsigned __int8)pValue;
6862 this->uMight -= (unsigned __int16)pValue; 6780 PlayAwardSound_Anim98(v4);
6863 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92); 6781 return result;
6864 return result; 6782 case VAR_BaseLevel:
6865 case VAR_BaseIntellect: 6783 this->uLevel -= (unsigned __int8)pValue;
6866 this->uIntelligence -= (unsigned __int16)pValue; 6784 PlayAwardSound_Anim98(v4);
6867 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92); 6785 return result;
6868 return result; 6786 case VAR_LevelModifier:
6869 case VAR_BasePersonality: 6787 this->sLevelModifier -= (unsigned __int8)pValue;
6870 this->uWillpower -= (unsigned __int16)pValue; 6788 PlayAwardSound_Anim98(v4);
6871 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92); 6789 return result;
6872 return result; 6790 case VAR_Age:
6873 case VAR_BaseEndurance: 6791 this->sAgeModifier -= (signed __int16)pValue;
6874 this->uEndurance -= (unsigned __int16)pValue; 6792 return result;
6875 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92); 6793 case VAR_Award:
6876 return result; 6794 _449B7E_toggle_bit(this->_achieved_awards_bits, (signed __int16)pValue, 0);
6877 case VAR_BaseSpeed: 6795 return result;
6878 this->uSpeed -= (unsigned __int16)pValue; 6796 case VAR_Experience:
6879 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92); 6797 this->uExperience -= pValue;
6880 return result; 6798 PlayAwardSound_Anim98(v4);
6881 case VAR_BaseAccuracy: 6799 return result;
6882 this->uAccuracy -= (unsigned __int16)pValue; 6800 case VAR_QBits_QuestsDone:
6883 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92); 6801 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0);
6884 return result; 6802 this->PlaySound(SPEECH_96, 0);
6885 case VAR_BaseLuck: 6803 return true;
6886 this->uLuck -= (unsigned __int16)pValue; 6804 case VAR_PlayerItemInHands:
6887 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92); 6805 for (v3 = 0; v3 < 126; v3++)
6888 return result; 6806 {
6889 case VAR_FireResistance: 6807 if ( this->pInventoryItemList[pInventoryMatrix[v3]].uItemID == pValue )
6890 this->sResFireBase -= (signed __int16)pValue;
6891 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6892 return result;
6893 case VAR_AirResistance:
6894 this->sResAirBase -= (signed __int16)pValue;
6895 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6896 return result;
6897 case VAR_WaterResistance:
6898 this->sResWaterBase -= (signed __int16)pValue;
6899 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6900 return result;
6901 case VAR_EarthResistance:
6902 this->sResEarthBase -= (signed __int16)pValue;
6903 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6904 return result;
6905 case VAR_SpiritResistance:
6906 this->sResSpiritBase -= (signed __int16)pValue;
6907 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6908 return result;
6909 case VAR_MindResistance:
6910 this->sResMindBase -= (signed __int16)pValue;
6911 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6912 return result;
6913 case VAR_BodyResistance:
6914 this->sResBodyBase -= (signed __int16)pValue;
6915 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6916 return result;
6917 case VAR_LightResistance:
6918 this->sResLightBase -= (signed __int16)pValue;
6919 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6920 return result;
6921 case VAR_DarkResistance:
6922 this->sResDarkBase -= (signed __int16)pValue;
6923 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6924 return result;
6925 case VAR_MagicResistance:
6926 this->sResMagicBase -= (signed __int16)pValue;
6927 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6928 return result;
6929 case VAR_FireResistanceBonus:
6930 this->sResFireBonus -= (signed __int16)pValue;
6931 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6932 return result;
6933 case VAR_AirResistanceBonus:
6934 this->sResAirBonus -= (signed __int16)pValue;
6935 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6936 return result;
6937 case VAR_WaterResistanceBonus:
6938 this->sResWaterBonus -= (signed __int16)pValue;
6939 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6940 return result;
6941 case VAR_EarthResistanceBonus:
6942 this->sResEarthBonus -= (signed __int16)pValue;
6943 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6944 return result;
6945 case VAR_SpiritResistanceBonus:
6946 this->sResSpiritBonus -= (signed __int16)pValue;
6947 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6948 return result;
6949 case VAR_MindResistanceBonus:
6950 this->sResMindBonus -= (signed __int16)pValue;
6951 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6952 return result;
6953 case VAR_BodyResistanceBonus:
6954 this->sResBodyBonus -= (signed __int16)pValue;
6955 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6956 return result;
6957 case VAR_LightResistanceBonus:
6958 this->sResLightBonus -= (signed __int16)pValue;
6959 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6960 return result;
6961 case VAR_DarkResistanceBonus:
6962 this->sResDarkBonus -= (signed __int16)pValue;
6963 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6964 return result;
6965 case VAR_MagicResistanceBonus:
6966 this->sResMagicBonus -= (signed __int16)pValue;
6967 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6968 return result;
6969 case VAR_FixedFood:
6970 Party::TakeFood((unsigned int)pValue);
6971 PlayAwardSound_Anim98(v4);
6972 return result;
6973 case VAR_StaffSkill:
6974 case VAR_SwordSkill:
6975 case VAR_DaggerSkill:
6976 case VAR_AxeSkill:
6977 case VAR_SpearSkill:
6978 case VAR_BowSkill:
6979 case VAR_MaceSkill:
6980 case VAR_BlasterSkill:
6981 case VAR_ShieldSkill:
6982 case VAR_LeatherSkill:
6983 case VAR_SkillChain:
6984 case VAR_PlateSkill:
6985 case VAR_FireSkill:
6986 case VAR_AirSkill:
6987 case VAR_WaterSkill:
6988 case VAR_EarthSkill:
6989 case VAR_SpiritSkill:
6990 case VAR_MindSkill:
6991 case VAR_BodySkill:
6992 case VAR_LightSkill:
6993 case VAR_DarkSkill:
6994 case VAR_IdentifyItemSkill:
6995 case VAR_MerchantSkill:
6996 case VAR_RepairSkill:
6997 case VAR_BodybuildingSkill:
6998 case VAR_MeditationSkill:
6999 case VAR_PerceptionSkill:
7000 case VAR_DiplomacySkill:
7001 case VAR_DisarmTrapSkill:
7002 case VAR_LearningSkill:
7003 *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue;
7004 PlayAwardSound_Anim98(v4);
7005 return result;
7006 case VAR_Cursed:
7007 case VAR_Weak:
7008 case VAR_Asleep:
7009 case VAR_Afraid:
7010 case VAR_Drunk:
7011 case VAR_Insane:
7012 case VAR_PoisonedGreen:
7013 case VAR_DiseasedGreen:
7014 case VAR_PoisonedYellow:
7015 case VAR_DiseasedYellow:
7016 case VAR_PoisonedRed:
7017 case VAR_DiseasedRed:
7018 case VAR_Paralyzed:
7019 case VAR_Unconsious:
7020 case VAR_Dead:
7021 case VAR_Stoned:
7022 case VAR_Eradicated:
7023 //*((int *)this + 2 * VarNum - 210) = 0;
7024 //*((int *)this + 2 * result - 209) = 0;
7025 this->pConditions[VarNum] = 0;
7026 PlayAwardSound_Anim98(v4);
7027 return result;
7028 default:
7029 return result;
7030 }
7031 for (v3 = 1; v3 < 126; v3++)
7032 {
7033 if ( *(&this->pInventoryItemList[pInventoryMatrix[v3] - 1].uItemID) == pValue )
7034 { 6808 {
7035 RemoveItemAtInventoryIndex(v3); 6809 RemoveItemAtInventoryIndex(v3);
7036 return true; 6810 return true;
7037 } 6811 }
7038 } 6812 }
7040 { 6814 {
7041 pMouse->RemoveHoldingItem(); 6815 pMouse->RemoveHoldingItem();
7042 return true; 6816 return true;
7043 } 6817 }
7044 return false; 6818 return false;
7045 } 6819 break;
7046 } 6820 case VAR_FixedGold:
7047 6821 if ( (unsigned int)pValue > pParty->uNumGold )
7048 //assert(false); 6822 {
6823 dword_5B65C4 = 1;
6824 return result;
6825 }
6826 Party::TakeGold((unsigned int)pValue);
6827 return result;
6828 case VAR_MightBonus:
6829 case VAR_ActualMight:
6830 this->uMightBonus -= (unsigned __int16)pValue;
6831 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6832 return result;
6833 case VAR_IntellectBonus:
6834 case VAR_ActualIntellect:
6835 this->uIntelligenceBonus -= (unsigned __int16)pValue;
6836 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6837 return result;
6838 case VAR_PersonalityBonus:
6839 case VAR_ActualPersonality:
6840 this->uWillpowerBonus -= (unsigned __int16)pValue;
6841 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6842 return result;
6843 case VAR_EnduranceBonus:
6844 case VAR_ActualEndurance:
6845 this->uEnduranceBonus -= (unsigned __int16)pValue;
6846 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6847 return result;
6848 case VAR_SpeedBonus:
6849 case VAR_ActualSpeed:
6850 this->uSpeedBonus -= (unsigned __int16)pValue;
6851 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6852 return result;
6853 case VAR_AccuracyBonus:
6854 case VAR_ActualAccuracy:
6855 this->uAccuracyBonus -= (unsigned __int16)pValue;
6856 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6857 return result;
6858 case VAR_LuckBonus:
6859 case VAR_ActualLuck:
6860 this->uLuckBonus -= (unsigned __int16)pValue;
6861 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6862 return result;
6863 case VAR_BaseMight:
6864 this->uMight -= (unsigned __int16)pValue;
6865 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6866 return result;
6867 case VAR_BaseIntellect:
6868 this->uIntelligence -= (unsigned __int16)pValue;
6869 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6870 return result;
6871 case VAR_BasePersonality:
6872 this->uWillpower -= (unsigned __int16)pValue;
6873 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6874 return result;
6875 case VAR_BaseEndurance:
6876 this->uEndurance -= (unsigned __int16)pValue;
6877 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6878 return result;
6879 case VAR_BaseSpeed:
6880 this->uSpeed -= (unsigned __int16)pValue;
6881 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6882 return result;
6883 case VAR_BaseAccuracy:
6884 this->uAccuracy -= (unsigned __int16)pValue;
6885 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6886 return result;
6887 case VAR_BaseLuck:
6888 this->uLuck -= (unsigned __int16)pValue;
6889 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6890 return result;
6891 case VAR_FireResistance:
6892 this->sResFireBase -= (signed __int16)pValue;
6893 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6894 return result;
6895 case VAR_AirResistance:
6896 this->sResAirBase -= (signed __int16)pValue;
6897 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6898 return result;
6899 case VAR_WaterResistance:
6900 this->sResWaterBase -= (signed __int16)pValue;
6901 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6902 return result;
6903 case VAR_EarthResistance:
6904 this->sResEarthBase -= (signed __int16)pValue;
6905 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6906 return result;
6907 case VAR_SpiritResistance:
6908 this->sResSpiritBase -= (signed __int16)pValue;
6909 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6910 return result;
6911 case VAR_MindResistance:
6912 this->sResMindBase -= (signed __int16)pValue;
6913 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6914 return result;
6915 case VAR_BodyResistance:
6916 this->sResBodyBase -= (signed __int16)pValue;
6917 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6918 return result;
6919 case VAR_LightResistance:
6920 this->sResLightBase -= (signed __int16)pValue;
6921 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6922 return result;
6923 case VAR_DarkResistance:
6924 this->sResDarkBase -= (signed __int16)pValue;
6925 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6926 return result;
6927 case VAR_MagicResistance:
6928 this->sResMagicBase -= (signed __int16)pValue;
6929 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6930 return result;
6931 case VAR_FireResistanceBonus:
6932 this->sResFireBonus -= (signed __int16)pValue;
6933 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6934 return result;
6935 case VAR_AirResistanceBonus:
6936 this->sResAirBonus -= (signed __int16)pValue;
6937 this->PlayAwardSound_Anim98_Face(v4, SPEECH_92);
6938 return result;
6939 case VAR_WaterResistanceBonus:
6940 this->sResWaterBonus -= (signed __int16)pValue;
6941 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6942 return result;
6943 case VAR_EarthResistanceBonus:
6944 this->sResEarthBonus -= (signed __int16)pValue;
6945 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6946 return result;
6947 case VAR_SpiritResistanceBonus:
6948 this->sResSpiritBonus -= (signed __int16)pValue;
6949 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6950 return result;
6951 case VAR_MindResistanceBonus:
6952 this->sResMindBonus -= (signed __int16)pValue;
6953 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6954 return result;
6955 case VAR_BodyResistanceBonus:
6956 this->sResBodyBonus -= (signed __int16)pValue;
6957 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6958 return result;
6959 case VAR_LightResistanceBonus:
6960 this->sResLightBonus -= (signed __int16)pValue;
6961 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6962 return result;
6963 case VAR_DarkResistanceBonus:
6964 this->sResDarkBonus -= (signed __int16)pValue;
6965 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6966 return result;
6967 case VAR_MagicResistanceBonus:
6968 this->sResMagicBonus -= (signed __int16)pValue;
6969 this->PlayAwardSound_Anim98_Face(v4, SPEECH_91);
6970 return result;
6971 case VAR_FixedFood:
6972 Party::TakeFood((unsigned int)pValue);
6973 PlayAwardSound_Anim98(v4);
6974 return result;
6975 case VAR_StaffSkill:
6976 case VAR_SwordSkill:
6977 case VAR_DaggerSkill:
6978 case VAR_AxeSkill:
6979 case VAR_SpearSkill:
6980 case VAR_BowSkill:
6981 case VAR_MaceSkill:
6982 case VAR_BlasterSkill:
6983 case VAR_ShieldSkill:
6984 case VAR_LeatherSkill:
6985 case VAR_SkillChain:
6986 case VAR_PlateSkill:
6987 case VAR_FireSkill:
6988 case VAR_AirSkill:
6989 case VAR_WaterSkill:
6990 case VAR_EarthSkill:
6991 case VAR_SpiritSkill:
6992 case VAR_MindSkill:
6993 case VAR_BodySkill:
6994 case VAR_LightSkill:
6995 case VAR_DarkSkill:
6996 case VAR_IdentifyItemSkill:
6997 case VAR_MerchantSkill:
6998 case VAR_RepairSkill:
6999 case VAR_BodybuildingSkill:
7000 case VAR_MeditationSkill:
7001 case VAR_PerceptionSkill:
7002 case VAR_DiplomacySkill:
7003 case VAR_DisarmTrapSkill:
7004 case VAR_LearningSkill:
7005 *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue;
7006 PlayAwardSound_Anim98(v4);
7007 return result;
7008 case VAR_Cursed:
7009 case VAR_Weak:
7010 case VAR_Asleep:
7011 case VAR_Afraid:
7012 case VAR_Drunk:
7013 case VAR_Insane:
7014 case VAR_PoisonedGreen:
7015 case VAR_DiseasedGreen:
7016 case VAR_PoisonedYellow:
7017 case VAR_DiseasedYellow:
7018 case VAR_PoisonedRed:
7019 case VAR_DiseasedRed:
7020 case VAR_Paralyzed:
7021 case VAR_Unconsious:
7022 case VAR_Dead:
7023 case VAR_Stoned:
7024 case VAR_Eradicated:
7025 this->pConditions[VarNum] = 0;
7026 PlayAwardSound_Anim98(v4);
7027 return result;
7028 }
7049 return false; 7029 return false;
7050 } 7030 }
7051 // 5B65C4: using guessed type int dword_5B65C4; 7031 // 5B65C4: using guessed type int dword_5B65C4;
7052 // 5B65CC: using guessed type int dword_5B65CC; 7032 // 5B65CC: using guessed type int dword_5B65CC;
7053 7033