comparison Player.cpp @ 143:163719cd2aca

DecreaseAttribute
author Ritor1
date Sat, 24 Nov 2012 18:25:13 +0600
parents 3b5267621a5b
children 38a1c8ef6874
comparison
equal deleted inserted replaced
142:be8cc11d830a 143:163719cd2aca
6625 //----- (0049048D) -------------------------------------------------------- 6625 //----- (0049048D) --------------------------------------------------------
6626 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute) 6626 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute)
6627 unsigned __int16 Player::DecreaseAttribute(int eAttribute) 6627 unsigned __int16 Player::DecreaseAttribute(int eAttribute)
6628 { 6628 {
6629 int v2; // eax@1 6629 int v2; // eax@1
6630 Player *v3; // edx@1 6630 //Player *pPlayer; // edx@1
6631 int v4; // ecx@1 6631 int pBaseValue; // ecx@1
6632 int v5; // ebx@1 6632 int pDroppedStep; // ebx@1
6633 int v6; // esi@1 6633 int pStep; // esi@1
6634 unsigned __int16 result; // ax@7 6634 unsigned __int16 result; // ax@7
6635 int v8; // edi@8 6635 //int v8; // edi@8
6636 int v9; // edi@12 6636 //int v9; // edi@12
6637 int v10; // edi@16 6637 //int v10; // edi@16
6638 int v11; // edi@20 6638 //int v11; // edi@20
6639 int v12; // edi@24 6639 //int v12; // edi@24
6640 int v13; // edi@28 6640 //int v13; // edi@28
6641 int v14; // edi@32 6641 //int v14; // edi@32
6642 int uMinValue; // [sp+Ch] [bp-4h]@1 6642 int uMinValue; // [sp+Ch] [bp-4h]@1
6643 6643
6644 v2 = eAttribute + 7 * GetRace(); 6644 v2 = eAttribute + 7 * GetRace();
6645 v4 = stru_4ED7B0.race[0].attr[v2].uBaseValue; 6645 pBaseValue = stru_4ED7B0.race[0].attr[v2].uBaseValue;
6646 v5 = stru_4ED7B0.race[0].attr[v2].uDroppedStep; 6646 pDroppedStep = stru_4ED7B0.race[0].attr[v2].uDroppedStep;
6647 uMinValue = v4 - 2; 6647 uMinValue = pBaseValue - 2;
6648 v6 = stru_4ED7B0.race[0].attr[v2].uBaseStep; 6648 pStep = stru_4ED7B0.race[0].attr[v2].uBaseStep;
6649 if ( eAttribute ) 6649 if ( eAttribute )
6650 { 6650 {
6651 switch ( eAttribute ) 6651 switch ( eAttribute )
6652 { 6652 {
6653 case 1: 6653 case 1: //Intelligence
6654 result = v3->uIntelligence; 6654 result = this->uIntelligence;
6655 v13 = v3->uIntelligence; 6655 //v13 = this->uIntelligence;
6656 if ( v13 <= v4 ) 6656 if ( result <= pBaseValue )
6657 v6 = v5; 6657 pStep = pDroppedStep;
6658 if ( v13 - v6 >= uMinValue ) 6658 if ( this->uIntelligence - pStep >= uMinValue )
6659 { 6659 {
6660 result -= v6; 6660 result -= pStep;
6661 v3->uIntelligence = result; 6661 this->uIntelligence = result;
6662 } 6662 }
6663 break; 6663 break;
6664 case 2: 6664 case 2://Willpower
6665 result = v3->uWillpower; 6665 result = this->uWillpower;
6666 v12 = v3->uWillpower; 6666 //v12 = this->uWillpower;
6667 if ( v12 <= v4 ) 6667 if ( result <= pBaseValue )
6668 v6 = v5; 6668 pStep = pDroppedStep;
6669 if ( v12 - v6 >= uMinValue ) 6669 if ( result - pStep >= uMinValue )
6670 { 6670 {
6671 result -= v6; 6671 result -= pStep;
6672 v3->uWillpower = result; 6672 this->uWillpower = result;
6673 } 6673 }
6674 break; 6674 break;
6675 case 3: 6675 case 3://Endurance
6676 result = v3->uEndurance; 6676 result = this->uEndurance;
6677 v11 = v3->uEndurance; 6677 //v11 = this->uEndurance;
6678 if ( v11 <= v4 ) 6678 if ( result <= pBaseValue )
6679 v6 = v5; 6679 pStep = pDroppedStep;
6680 if ( v11 - v6 >= uMinValue ) 6680 if ( result - pStep >= uMinValue )
6681 { 6681 {
6682 result -= v6; 6682 result -= pStep;
6683 v3->uEndurance = result; 6683 this->uEndurance = result;
6684 } 6684 }
6685 break; 6685 break;
6686 case 4: 6686 case 4://Accuracy
6687 result = v3->uAccuracy; 6687 result = this->uAccuracy;
6688 v10 = v3->uAccuracy; 6688 //v10 = this->uAccuracy;
6689 if ( v10 <= v4 ) 6689 if ( result <= pBaseValue )
6690 v6 = v5; 6690 pStep = pDroppedStep;
6691 if ( v10 - v6 >= uMinValue ) 6691 if ( result - pStep >= uMinValue )
6692 { 6692 {
6693 result -= v6; 6693 result -= pStep;
6694 v3->uAccuracy = result; 6694 this->uAccuracy = result;
6695 } 6695 }
6696 break; 6696 break;
6697 case 5: 6697 case 5://Speed
6698 result = v3->uSpeed; 6698 result = this->uSpeed;
6699 v9 = v3->uSpeed; 6699 //v9 = this->uSpeed;
6700 if ( v9 <= v4 ) 6700 if ( result <= pBaseValue )
6701 v6 = v5; 6701 pStep = pDroppedStep;
6702 if ( v9 - v6 >= uMinValue ) 6702 if ( result - pStep >= uMinValue )
6703 { 6703 {
6704 result -= v6; 6704 result -= pStep;
6705 v3->uSpeed = result; 6705 this->uSpeed = result;
6706 } 6706 }
6707 break; 6707 break;
6708 default: 6708 default:
6709 result = eAttribute - 6; 6709 result = eAttribute - 6;
6710 if ( eAttribute == 6 ) 6710 if ( eAttribute == 6 )//Luck
6711 { 6711 {
6712 result = v3->uLuck; 6712 result = this->uLuck;
6713 v8 = v3->uLuck; 6713 //v8 = this->uLuck;
6714 if ( v8 <= v4 ) 6714 if ( result <= pBaseValue )
6715 v6 = v5; 6715 pStep = pDroppedStep;
6716 if ( v8 - v6 >= uMinValue ) 6716 if ( result - pStep >= uMinValue )
6717 { 6717 {
6718 result -= v6; 6718 result -= pStep;
6719 v3->uLuck = result; 6719 this->uLuck = result;
6720 } 6720 }
6721 } 6721 }
6722 break; 6722 break;
6723 } 6723 }
6724 } 6724 }
6725 else 6725 else
6726 { 6726 {
6727 result = v3->uMight; 6727 result = this->uMight;
6728 v14 = v3->uMight; 6728 //v14 = this->uMight;
6729 if ( v14 <= v4 ) 6729 if ( result <= pBaseValue )
6730 v6 = v5; 6730 pStep = pDroppedStep;
6731 if ( v14 - v6 >= uMinValue ) 6731 if ( result - pStep >= uMinValue )
6732 { 6732 {
6733 result -= v6; 6733 result -= pStep;
6734 v3->uMight = result; 6734 this->uMight = result;
6735 } 6735 }
6736 } 6736 }
6737 return result; 6737 return result;
6738 } 6738 }
6739 6739