Mercurial > mm7
comparison Player.cpp @ 1617:8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
author | Grumpy7 |
---|---|
date | Sat, 14 Sep 2013 06:56:05 +0200 |
parents | 434b796cdfd3 |
children | f5b13e6be493 |
comparison
equal
deleted
inserted
replaced
1605:434b796cdfd3 | 1617:8e3c6d7631f1 |
---|---|
3466 return v3 + v4; | 3466 return v3 + v4; |
3467 } | 3467 } |
3468 | 3468 |
3469 //----- (0048F882) -------------------------------------------------------- | 3469 //----- (0048F882) -------------------------------------------------------- |
3470 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType ) | 3470 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType ) |
3471 { | 3471 { |
3472 signed int bonus_value; // esi@1 | 3472 signed int bonus_value; // esi@1 |
3473 unsigned __int16 skill_value; // ax@126 | 3473 unsigned __int16 skill_value; // ax@126 |
3474 int result; // al@127 | 3474 int result; // al@127 |
3475 | 3475 |
3476 bonus_value = 0; | 3476 bonus_value = 0; |
3939 // 22 underwater suits (unused) | 3939 // 22 underwater suits (unused) |
3940 // 23 zombie male | 3940 // 23 zombie male |
3941 // 24 zombie female | 3941 // 24 zombie female |
3942 enum CHARACTER_RACE Player::GetRace() | 3942 enum CHARACTER_RACE Player::GetRace() |
3943 { | 3943 { |
3944 if ( uCurrentFace > 15 ) | 3944 if ( uCurrentFace <= 7 ) |
3945 { | 3945 { |
3946 if ( uCurrentFace >= 16 && uCurrentFace <= 19 ) | 3946 return CHARACTER_RACE_HUMAN; |
3947 return CHARACTER_RACE_GOBLIN; | 3947 } |
3948 else if ( uCurrentFace <= 11 ) | |
3949 { | |
3950 return CHARACTER_RACE_ELF; | |
3951 } | |
3952 else if ( uCurrentFace <= 15 ) | |
3953 { | |
3954 return CHARACTER_RACE_DWARF; | |
3955 } | |
3956 else if ( uCurrentFace <= 19 ) | |
3957 { | |
3958 return CHARACTER_RACE_GOBLIN; | |
3948 } | 3959 } |
3949 else | 3960 else |
3950 { | 3961 { |
3951 if ( uCurrentFace >= 12 ) | 3962 return CHARACTER_RACE_HUMAN; |
3952 { | 3963 } |
3953 return CHARACTER_RACE_DWARF; | |
3954 } | |
3955 else | |
3956 { | |
3957 | |
3958 if ( uCurrentFace <= 7 ) | |
3959 { | |
3960 return CHARACTER_RACE_HUMAN; | |
3961 } | |
3962 else | |
3963 { | |
3964 if ( uCurrentFace <= 11 ) | |
3965 return CHARACTER_RACE_ELF; | |
3966 } | |
3967 } | |
3968 } | |
3969 return CHARACTER_RACE_HUMAN; | |
3970 } | 3964 } |
3971 | 3965 |
3972 //----- (00490141) -------------------------------------------------------- | 3966 //----- (00490141) -------------------------------------------------------- |
3973 PLAYER_SEX Player::GetSexByVoice() | 3967 PLAYER_SEX Player::GetSexByVoice() |
3974 { | 3968 { |
3975 signed int result; // eax@1 | |
3976 | |
3977 result = 0; | |
3978 switch ( this->uVoiceID ) | 3969 switch ( this->uVoiceID ) |
3979 { | 3970 { |
3980 case 0u: | 3971 case 0u: |
3981 case 1u: | 3972 case 1u: |
3982 case 2u: | 3973 case 2u: |
4022 uLuck = StatTable[v1][6].uBaseValue; | 4013 uLuck = StatTable[v1][6].uBaseValue; |
4023 } | 4014 } |
4024 | 4015 |
4025 //----- (004901FC) -------------------------------------------------------- | 4016 //----- (004901FC) -------------------------------------------------------- |
4026 void Player::SetSexByVoice() | 4017 void Player::SetSexByVoice() |
4027 { | 4018 { |
4028 switch ( this->uVoiceID) | 4019 switch ( this->uVoiceID) |
4029 { | 4020 { |
4030 case 0: | 4021 case 0: |
4031 case 1: | 4022 case 1: |
4032 case 2: | 4023 case 2: |
4054 case 0x15: | 4045 case 0x15: |
4055 case 0x18: | 4046 case 0x18: |
4056 this->uSex = SEX_FEMALE; | 4047 this->uSex = SEX_FEMALE; |
4057 break; | 4048 break; |
4058 default: | 4049 default: |
4050 Error("(%u)", this->uVoiceID); | |
4059 break; | 4051 break; |
4060 } | 4052 } |
4061 | 4053 |
4062 } | 4054 } |
4063 | 4055 |
4262 | 4254 |
4263 //----- (0049048D) -------------------------------------------------------- | 4255 //----- (0049048D) -------------------------------------------------------- |
4264 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute) | 4256 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute) |
4265 void Player::DecreaseAttribute(int eAttribute) | 4257 void Player::DecreaseAttribute(int eAttribute) |
4266 { | 4258 { |
4267 int v2; // eax@1 | |
4268 int pBaseValue; // ecx@1 | 4259 int pBaseValue; // ecx@1 |
4269 int pDroppedStep; // ebx@1 | 4260 int pDroppedStep; // ebx@1 |
4270 int pStep; // esi@1 | 4261 int pStep; // esi@1 |
4271 unsigned __int16 result; // ax@7 | |
4272 int uMinValue; // [sp+Ch] [bp-4h]@1 | 4262 int uMinValue; // [sp+Ch] [bp-4h]@1 |
4273 | 4263 |
4274 v2 = eAttribute + 7 * GetRace(); | 4264 int raceId = GetRace(); |
4275 pBaseValue = StatTable[0][v2].uBaseValue; | 4265 pBaseValue = StatTable[raceId][eAttribute].uBaseValue; |
4276 pDroppedStep = StatTable[0][v2].uDroppedStep; | 4266 pDroppedStep = StatTable[raceId][eAttribute].uDroppedStep; |
4277 uMinValue = pBaseValue - 2; | 4267 uMinValue = pBaseValue - 2; |
4278 pStep = StatTable[0][v2].uBaseStep; | 4268 pStep = StatTable[raceId][eAttribute].uBaseStep; |
4279 unsigned short* AttrToChange = nullptr; | 4269 unsigned short* AttrToChange = nullptr; |
4280 switch ( eAttribute ) | 4270 switch ( eAttribute ) |
4281 { | 4271 { |
4282 case CHARACTER_ATTRIBUTE_STRENGTH: | 4272 case CHARACTER_ATTRIBUTE_STRENGTH: |
4283 AttrToChange = &this->uMight; | 4273 AttrToChange = &this->uMight; |