Mercurial > mm7
comparison Player.cpp @ 1536:e264ce95f27d
Player:GetSkillBonus cleanup, undoing part of previous changeset to better track file modifications
author | Grumpy7 |
---|---|
date | Sat, 07 Sep 2013 04:15:06 +0200 |
parents | a18076b22fb7 |
children | fed56133bf8a |
comparison
equal
deleted
inserted
replaced
1535:a18076b22fb7 | 1536:e264ce95f27d |
---|---|
5146 if ( (signed int)v20 >= 16 ) | 5146 if ( (signed int)v20 >= 16 ) |
5147 return 0; | 5147 return 0; |
5148 } | 5148 } |
5149 v71 = 0; | 5149 v71 = 0; |
5150 v23 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[v22].uSkillType; | 5150 v23 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[v22].uSkillType; |
5151 v25 = v2->GetActualSkillLevel(v23); | 5151 LOBYTE(v24) = v2->GetActualSkillLevel(v23); |
5152 v26 = SkillToMastery(v25); | 5152 v25 = v24; |
5153 v26 = SkillToMastery(v24); | |
5153 switch (v23) | 5154 switch (v23) |
5154 { | 5155 { |
5155 case PLAYER_SKILL_STAFF: | 5156 case PLAYER_SKILL_STAFF: |
5156 if ( (signed int)SkillToMastery(v25) >= 4 && v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) | 5157 if ( (signed int)SkillToMastery(v25) >= 4 && v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) |
5157 { | 5158 { |
5158 v31 = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | 5159 v31 = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED); |
5159 multiplier = GetMultiplierForMastery(v31, 0, 1, 2, 2); | 5160 if ( v31 ) |
5160 return multiplier * (v31 & 0x3F); | 5161 { |
5162 v32 = SkillToMastery(v31); | |
5163 switch (v32) | |
5164 { | |
5165 case 1: multiplier=0; break; | |
5166 case 2: multiplier=1; break; | |
5167 case 3: multiplier=2; break; | |
5168 case 4: multiplier=2; break; | |
5169 } | |
5170 return multiplier * (v31 & 0x3F); | |
5171 } | |
5161 } | 5172 } |
5162 else | 5173 else |
5163 { | 5174 { |
5164 return arm_bonus; | 5175 return arm_bonus; |
5165 } | 5176 } |
5166 break; | 5177 break; |
5167 | 5178 |
5168 case PLAYER_SKILL_DAGGER: | 5179 case PLAYER_SKILL_DAGGER: |
5169 multiplier = GetMultiplierForMastery(v25, 0, 0, 0, 1); | 5180 v29 = SkillToMastery(v25); |
5181 switch (v29) | |
5182 { | |
5183 case 1: multiplier=0; break; | |
5184 case 2: multiplier=0; break; | |
5185 case 3: multiplier=0; break; | |
5186 case 4: multiplier=1; break; | |
5187 } | |
5170 v30 = multiplier * (v29 & 0x3F); | 5188 v30 = multiplier * (v29 & 0x3F); |
5171 return arm_bonus + v30; | 5189 return arm_bonus + v30; |
5172 break; | 5190 break; |
5173 case PLAYER_SKILL_SWORD: | 5191 case PLAYER_SKILL_SWORD: |
5174 return arm_bonus; | 5192 return arm_bonus; |
5175 break; | 5193 break; |
5176 case PLAYER_SKILL_MACE: | 5194 case PLAYER_SKILL_MACE: |
5177 case PLAYER_SKILL_SPEAR: | 5195 case PLAYER_SKILL_SPEAR: |
5178 multiplier = GetMultiplierForMastery(v25, 0, 1, 1, 1); | 5196 v29 = SkillToMastery(v25); |
5197 switch (v29) | |
5198 { | |
5199 case 1: multiplier=0; break; | |
5200 case 2: multiplier=1; break; | |
5201 case 3: multiplier=1; break; | |
5202 case 4: multiplier=1; break; | |
5203 } | |
5179 v30 = multiplier * (v29 & 0x3F); | 5204 v30 = multiplier * (v29 & 0x3F); |
5180 return arm_bonus + v30; | 5205 return arm_bonus + v30; |
5181 break; | 5206 break; |
5182 case PLAYER_SKILL_AXE: | 5207 case PLAYER_SKILL_AXE: |
5183 multiplier = GetMultiplierForMastery(v25, 0, 0, 1, 1); | 5208 v29 = SkillToMastery(v25); |
5209 switch (v29) | |
5210 { | |
5211 case 1: multiplier=0; break; | |
5212 case 2: multiplier=0; break; | |
5213 case 3: multiplier=1; break; | |
5214 case 4: multiplier=1; break; | |
5215 } | |
5184 v30 = multiplier * (v29 & 0x3F); | 5216 v30 = multiplier * (v29 & 0x3F); |
5185 return arm_bonus + v30; | 5217 return arm_bonus + v30; |
5186 break; | 5218 break; |
5187 } | 5219 } |
5188 } | 5220 } |
5189 default: | 5221 default: |
5190 return 0; | 5222 return 0; |
5191 } | 5223 } |
5192 } | 5224 |
5193 | 5225 } |
5194 unsigned int Player::GetMultiplierForMastery(unsigned int skillValue, int mult1, int mult2, int mult3, int mult4) | 5226 |
5195 { | |
5196 int masteryLvl = SkillToMastery(skillValue); | |
5197 switch (masteryLvl) | |
5198 { | |
5199 case 1: return mult1; | |
5200 case 2: return mult2; | |
5201 case 3: return mult3; | |
5202 case 4: return mult4; | |
5203 } | |
5204 } | |
5205 //----- (00490109) -------------------------------------------------------- | 5227 //----- (00490109) -------------------------------------------------------- |
5206 // faces are: 0 1 2 3 human males | 5228 // faces are: 0 1 2 3 human males |
5207 // 4 5 6 7 human females | 5229 // 4 5 6 7 human females |
5208 // 8 9 elf males | 5230 // 8 9 elf males |
5209 // 10 11 elf females | 5231 // 10 11 elf females |