comparison Player.cpp @ 1534:d4bc1cb9d953

Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
author Grumpy7
date Sat, 07 Sep 2013 02:42:54 +0200
parents a2e1174c428b
children a18076b22fb7
comparison
equal deleted inserted replaced
1533:a2e1174c428b 1534:d4bc1cb9d953
4801 else 4801 else
4802 result = skill_value & 0xFFFC | 0x3C; //al 4802 result = skill_value & 0xFFFC | 0x3C; //al
4803 return result; 4803 return result;
4804 } 4804 }
4805 4805
4806
4806 //----- (0048FC00) -------------------------------------------------------- 4807 //----- (0048FC00) --------------------------------------------------------
4807 int Player::GetSkillBonus(enum CHARACTER_ATTRIBUTE_TYPE a2) 4808 int Player::GetSkillBonus(enum CHARACTER_ATTRIBUTE_TYPE a2)
4808 { 4809 {
4809 Player *v2; // esi@1 4810 Player *v2; // esi@1
4810 int armmaster_skill; // eax@1 4811 int armmaster_skill; // eax@1
4870 int v64; // [sp+Ch] [bp-20h]@104 4871 int v64; // [sp+Ch] [bp-20h]@104
4871 int v65; // [sp+10h] [bp-1Ch]@104 4872 int v65; // [sp+10h] [bp-1Ch]@104
4872 int v66; // [sp+14h] [bp-18h]@104 4873 int v66; // [sp+14h] [bp-18h]@104
4873 int v67; // [sp+18h] [bp-14h]@104 4874 int v67; // [sp+18h] [bp-14h]@104
4874 int v68; // [sp+1Ch] [bp-10h]@69 4875 int v68; // [sp+1Ch] [bp-10h]@69
4875 PlayerEquipment *v69; // [sp+20h] [bp-Ch]@1 4876 //PlayerEquipment *v69; // [sp+20h] [bp-Ch]@1
4876 int skill_bonus; // [sp+24h] [bp-8h]@1 4877 int skill_bonus; // [sp+24h] [bp-8h]@1
4877 ITEM_EQUIP_TYPE v71; // [sp+28h] [bp-4h]@1 4878 ITEM_EQUIP_TYPE v71; // [sp+28h] [bp-4h]@1
4878 int a1; // [sp+34h] [bp+8h]@21 4879 int a1; // [sp+34h] [bp+8h]@21
4879 int a1a; // [sp+34h] [bp+8h]@74 4880 int a1a; // [sp+34h] [bp+8h]@74
4880 signed int a1b; // [sp+34h] [bp+8h]@94 4881 signed int a1b; // [sp+34h] [bp+8h]@94
4882 int arm_bonus; 4883 int arm_bonus;
4883 int lvl_avl[4]; 4884 int lvl_avl[4];
4884 4885
4885 v2 = this; 4886 v2 = this;
4886 skill_bonus = 0; 4887 skill_bonus = 0;
4887 v69 = 0; 4888 //v69 = 0;
4888 multiplier =0; 4889 multiplier =0;
4889 arm_bonus =0; 4890 arm_bonus =0;
4890 v71 = (ITEM_EQUIP_TYPE)0; 4891 v71 = (ITEM_EQUIP_TYPE)0;
4891 armmaster_skill = GetActualSkillLevel(PLAYER_SKILL_ARMSMASTER); 4892 armmaster_skill = GetActualSkillLevel(PLAYER_SKILL_ARMSMASTER);
4892 v4 = armmaster_skill; 4893 v4 = armmaster_skill;
4908 else if ( armaster_mastery >= 2 ) 4909 else if ( armaster_mastery >= 2 )
4909 multiplier =1; 4910 multiplier =1;
4910 } 4911 }
4911 arm_bonus=(armmaster_skill&0x3F)*multiplier; 4912 arm_bonus=(armmaster_skill&0x3F)*multiplier;
4912 } 4913 }
4913 4914
4914 if ( a2 == CHARACTER_ATTRIBUTE_HEALTH ) 4915 switch(a2)
4915 { 4916 {
4916 base_value = pBaseHealthPerLevelByClass[classType]; 4917 case CHARACTER_ATTRIBUTE_HEALTH:
4917 attrib_modif = GetBodybuilding(); 4918 {
4918 return base_value * attrib_modif; 4919 base_value = pBaseHealthPerLevelByClass[classType];
4919 } 4920 attrib_modif = GetBodybuilding();
4920 if ( a2 == CHARACTER_ATTRIBUTE_MANA ) 4921 return base_value * attrib_modif;
4921 { 4922 }
4922 base_value = pBaseManaPerLevelByClass[classType]; 4923 break;
4923 attrib_modif = GetMeditation(); 4924 case CHARACTER_ATTRIBUTE_MANA:
4924 return base_value * attrib_modif; 4925 {
4925 } 4926 base_value = pBaseManaPerLevelByClass[classType];
4926 if ( a2 == CHARACTER_ATTRIBUTE_AC_BONUS ) 4927 attrib_modif = GetMeditation();
4927 { 4928 return base_value * attrib_modif;
4928 a1b = 0; 4929 }
4929 v71 = (ITEM_EQUIP_TYPE)0; 4930 break;
4930 4931 case CHARACTER_ATTRIBUTE_AC_BONUS:
4931 for (j=0; j<16; ++j) 4932 {
4932 { 4933 a1b = 0;
4933 if (pEquipment.pIndices[j]&&(!pOwnItems[ pEquipment.pIndices[j]].Broken())) 4934 v71 = (ITEM_EQUIP_TYPE)0;
4934 { 4935
4935 int curr_item =pOwnItems[pEquipment.pIndices[j]].uItemID; 4936 for (j=0; j<16; ++j)
4936 v44=pItemsTable->pItems[curr_item].uSkillType; 4937 {
4937 switch (v44) 4938 if (pEquipment.pIndices[j]&&(!pOwnItems[ pEquipment.pIndices[j]].Broken()))
4938 { 4939 {
4939 case PLAYER_SKILL_STAFF: 4940 int curr_item =pOwnItems[pEquipment.pIndices[j]].uItemID;
4940 4941 v44=pItemsTable->pItems[curr_item].uSkillType;
4941 lvl_avl[0]=0; 4942 switch (v44)
4942 lvl_avl[1]=1; 4943 {
4943 lvl_avl[2]=0; 4944 case PLAYER_SKILL_STAFF:
4944 lvl_avl[3]=0; 4945
4945 break; 4946 lvl_avl[0]=0;
4946 case PLAYER_SKILL_SWORD: 4947 lvl_avl[1]=1;
4947 case PLAYER_SKILL_SPEAR: 4948 lvl_avl[2]=0;
4948 lvl_avl[0]=0; 4949 lvl_avl[3]=0;
4949 lvl_avl[1]=0; 4950 break;
4950 lvl_avl[2]=0; 4951 case PLAYER_SKILL_SWORD:
4951 lvl_avl[3]=1; 4952 case PLAYER_SKILL_SPEAR:
4952 break; 4953 lvl_avl[0]=0;
4953 case PLAYER_SKILL_SHIELD: 4954 lvl_avl[1]=0;
4954 a1b = 1; 4955 lvl_avl[2]=0;
4955 lvl_avl[0]=1; 4956 lvl_avl[3]=1;
4956 lvl_avl[1]=0; 4957 break;
4957 lvl_avl[2]=1; 4958 case PLAYER_SKILL_SHIELD:
4958 lvl_avl[3]=0; 4959 a1b = 1;
4959 break; 4960 lvl_avl[0]=1;
4960 case PLAYER_SKILL_LEATHER: 4961 lvl_avl[1]=0;
4961 v71 = (ITEM_EQUIP_TYPE)1; 4962 lvl_avl[2]=1;
4962 lvl_avl[0]=1; 4963 lvl_avl[3]=0;
4963 lvl_avl[1]=0; 4964 break;
4964 lvl_avl[2]=1; 4965 case PLAYER_SKILL_LEATHER:
4965 lvl_avl[3]=0; 4966 v71 = (ITEM_EQUIP_TYPE)1;
4966 4967 lvl_avl[0]=1;
4967 break; 4968 lvl_avl[1]=0;
4968 case PLAYER_SKILL_CHAIN: 4969 lvl_avl[2]=1;
4969 a1b = 1; 4970 lvl_avl[3]=0;
4970 lvl_avl[0]=1; 4971
4971 lvl_avl[1]=0; 4972 break;
4972 lvl_avl[2]=0; 4973 case PLAYER_SKILL_CHAIN:
4973 lvl_avl[3]=0; 4974 a1b = 1;
4974 break; 4975 lvl_avl[0]=1;
4975 case PLAYER_SKILL_PLATE: 4976 lvl_avl[1]=0;
4976 a1b = 1; 4977 lvl_avl[2]=0;
4977 lvl_avl[0]=1; 4978 lvl_avl[3]=0;
4978 lvl_avl[1]=0; 4979 break;
4979 lvl_avl[2]=0; 4980 case PLAYER_SKILL_PLATE:
4980 lvl_avl[3]=0; 4981 a1b = 1;
4981 break; 4982 lvl_avl[0]=1;
4982 default: 4983 lvl_avl[1]=0;
4983 continue; 4984 lvl_avl[2]=0;
4985 lvl_avl[3]=0;
4986 break;
4987 default:
4988 continue;
4989 }
4990
4991 v50= GetActualSkillLevel((PLAYER_SKILL_TYPE)v44);
4992 v51 = v50;
4993 v52 = SkillToMastery(v50);
4994 v53 = v51 & 0x3F;
4995 for ( i = 0; i < (signed int)v52; ++i )
4996 {
4997 if ( lvl_avl[i] )
4998 skill_bonus += v53;
4999 }
4984 } 5000 }
4985 5001 }
4986 v50= GetActualSkillLevel((PLAYER_SKILL_TYPE)v44); 5002
4987 v51 = v50; 5003 lvl_avl[0]=1;
4988 v52 = SkillToMastery(v50); 5004 lvl_avl[1]=1;
4989 v53 = v51 & 0x3F; 5005 lvl_avl[2]=1;
4990 for ( i = 0; i < (signed int)v52; ++i ) 5006 lvl_avl[3]=0;
5007
5008 v55 = GetActualSkillLevel(PLAYER_SKILL_DODGE);
5009 v56 = v55;
5010 v57 = SkillToMastery(v55);
5011 if ( !a1b && (!v71 || v57 == 4) )
5012 {
5013 v58 = v56 & 0x3F;
5014 for ( j = 0; j < (signed int)v57; ++j )
4991 { 5015 {
4992 if ( lvl_avl[i] ) 5016 if ( lvl_avl[j] )
4993 skill_bonus += v53; 5017 skill_bonus += v58;
4994 } 5018 }
4995 } 5019 }
4996 } 5020 return skill_bonus;
4997 5021 }
4998 lvl_avl[0]=1; 5022 break;
4999 lvl_avl[1]=1; 5023 case CHARACTER_ATTRIBUTE_ATTACK:
5000 lvl_avl[2]=1; 5024 {
5001 lvl_avl[3]=0; 5025 if ( v2->IsUnarmed() == 1 )
5002 5026 {
5003 v55 = GetActualSkillLevel(PLAYER_SKILL_DODGE); 5027 v33 = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
5004 v56 = v55; 5028 v34 = v33;
5005 v57 = SkillToMastery(v55); 5029 if ( !v33 )
5006 if ( !a1b && (!v71 || v57 == 4) ) 5030 return skill_bonus;
5007 { 5031 if ( SkillToMastery(v33) >= 3 )
5008 v58 = v56 & 0x3F; 5032 multiplier = 2;
5009 for ( j = 0; j < (signed int)v57; ++j ) 5033 else
5010 { 5034 multiplier=1;
5011 if ( lvl_avl[j] ) 5035 v30 = multiplier * (v34 & 0x3F);
5012 skill_bonus += v58; 5036 return arm_bonus + v30;
5013 } 5037 }
5014 } 5038 v35 = (ITEM_EQUIP_TYPE)0;
5015 return skill_bonus; 5039 v68 = 0;
5016 } 5040 for (i=0; i<16 ; ++i)
5017 5041 {
5018 if (a2 == CHARACTER_ATTRIBUTE_ATTACK) 5042 if ( v2->HasItemEquipped((ITEM_EQUIP_TYPE)i) )
5019 { 5043 {
5020 if ( v2->IsUnarmed() == 1 ) 5044 v37 = v2->pEquipment.pIndices[i]-1;
5021 { 5045 if ( pItemsTable->pItems[v37].uEquipType <= EQUIP_MAIN_HAND)
5022 v33 = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED); 5046 break;
5023 v34 = v33; 5047 }
5024 if ( !v33 ) 5048 }
5049 if ( i >= 16 )
5025 return skill_bonus; 5050 return skill_bonus;
5026 if ( SkillToMastery(v33) >= 3 ) 5051
5027 multiplier = 2; 5052 v38 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[v37].uSkillType;
5028 else 5053 a1a = v2->GetActualSkillLevel(v38);
5029 multiplier=1; 5054 v39= SkillToMastery(a1a);
5030 v30 = multiplier * (v34 & 0x3F); 5055 v71 = (ITEM_EQUIP_TYPE)0;
5056 switch (v38)
5057 {
5058 case PLAYER_SKILL_STAFF:
5059 v71 = (ITEM_EQUIP_TYPE)1;
5060 if ( v39 == 4 )
5061 {
5062 v40 = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
5063 v41 = v40;
5064
5065 if ( v40 )
5066 {
5067 if ( SkillToMastery(v40) >= 3 )
5068 multiplier = 2;
5069 else
5070 multiplier=1;
5071 v68 = multiplier * (v41 & 0x3F);
5072 }
5073 }
5074 break;
5075 case PLAYER_SKILL_SWORD:
5076 case PLAYER_SKILL_DAGGER:
5077 case PLAYER_SKILL_AXE:
5078 case PLAYER_SKILL_SPEAR:
5079 case PLAYER_SKILL_MACE:
5080 v71 = (ITEM_EQUIP_TYPE)1;
5081 break;
5082 case PLAYER_SKILL_BLASTER:
5083
5084 switch (v39)
5085 {
5086 case 0: multiplier=1; break;
5087 case 1: multiplier=3; break;
5088 case 3: multiplier=3; break;
5089 case 4: multiplier=5; break;
5090 }
5091 v5 = multiplier;
5092 return v5 * (a1a & 0x3F);
5093 break;
5094 }
5095
5096 v30 = v68 + v71 * (a1a & 0x3F);
5031 return arm_bonus + v30; 5097 return arm_bonus + v30;
5032 } 5098 }
5033 v35 = (ITEM_EQUIP_TYPE)0; 5099 break;
5034 v68 = 0; 5100
5035 for (i=0; i<16 ; ++i) 5101 case CHARACTER_ATTRIBUTE_RANGED_ATTACK:
5036 { 5102 {
5037 if ( v2->HasItemEquipped((ITEM_EQUIP_TYPE)i) )
5038 {
5039 v37 = v2->pEquipment.pIndices[i]-1;
5040 if ( pItemsTable->pItems[v37].uEquipType <= EQUIP_MAIN_HAND)
5041 break;
5042 }
5043 }
5044 if ( i >= 16 )
5045 return skill_bonus;
5046
5047 v38 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[v37].uSkillType;
5048 a1a = v2->GetActualSkillLevel(v38);
5049 v39= SkillToMastery(a1a);
5050 v71 = (ITEM_EQUIP_TYPE)0;
5051 switch (v38)
5052 {
5053 case PLAYER_SKILL_STAFF:
5054 v71 = (ITEM_EQUIP_TYPE)1;
5055 if ( v39 == 4 )
5056 {
5057 v40 = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
5058 v41 = v40;
5059
5060 if ( v40 )
5061 {
5062 if ( SkillToMastery(v40) >= 3 )
5063 multiplier = 2;
5064 else
5065 multiplier=1;
5066 v68 = multiplier * (v41 & 0x3F);
5067 }
5068 }
5069 break;
5070 case PLAYER_SKILL_SWORD:
5071 case PLAYER_SKILL_DAGGER:
5072 case PLAYER_SKILL_AXE:
5073 case PLAYER_SKILL_SPEAR:
5074 case PLAYER_SKILL_MACE:
5075 v71 = (ITEM_EQUIP_TYPE)1;
5076 break;
5077 case PLAYER_SKILL_BLASTER:
5078
5079 switch (v39)
5080 {
5081 case 0: multiplier=1; break;
5082 case 1: multiplier=3; break;
5083 case 3: multiplier=3; break;
5084 case 4: multiplier=5; break;
5085 }
5086 v5 = multiplier;
5087 return v5 * (a1a & 0x3F);
5088 break;
5089 }
5090
5091 v30 = v68 + v71 * (a1a & 0x3F);
5092 return (int)((char *)v69 + v30);
5093 }
5094
5095
5096 if ( a2 != 9 )
5097 {
5098 if ( a2 <= CHARACTER_ATTRIBUTE_ATTACK )
5099 return skill_bonus;
5100 if ( a2 > CHARACTER_ATTRIBUTE_MELEE_DMG_MAX )
5101 {
5102 if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK )
5103 return skill_bonus;
5104 v71 = (ITEM_EQUIP_TYPE)0; 5103 v71 = (ITEM_EQUIP_TYPE)0;
5105 v9 = &v2->pEquipment; 5104 v9 = &v2->pEquipment;
5106 while ( 1 ) 5105 while ( 1 )
5107 { 5106 {
5108 if ( v2->HasItemEquipped(v71) ) 5107 if ( v2->HasItemEquipped(v71) )
5125 v14 = a1; 5124 v14 = a1;
5126 v15 = 1; 5125 v15 = 1;
5127 if ( (signed int)SkillToMastery(a1) >= 4 ) 5126 if ( (signed int)SkillToMastery(a1) >= 4 )
5128 { 5127 {
5129 v62 = 5; 5128 v62 = 5;
5130 goto LABEL_31; 5129 v15 = v62;
5131 }
5132 if ( (signed int)SkillToMastery(a1) >= 3 )
5133 {
5134 v62 = 3;
5135 goto LABEL_31;
5136 }
5137 if ( (signed int)SkillToMastery(a1) < 2 )
5138 goto LABEL_32;
5139 goto LABEL_30;
5140 }
5141 if ( v2->IsUnarmed() )
5142 {
5143 LOBYTE(v18) = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
5144 v14 = v18;
5145 if ( !v18 )
5146 return skill_bonus;
5147 v15 = 0;
5148 v19 = SkillToMastery(v18);
5149 if ( (signed int)v19 < 3 )
5150 {
5151 if ( (signed int)v19 >= 2 )
5152 v15 = 1;
5153 LABEL_32:
5154 v16 = v14; 5130 v16 = v14;
5155 return v15 * (v16 & 0x3F); 5131 return v15 * (v16 & 0x3F);
5156 } 5132 }
5157 LABEL_30: 5133 if ( (signed int)SkillToMastery(a1) >= 3 )
5134 {
5135 v62 = 3;
5136 v15 = v62;
5137 v16 = v14;
5138 return v15 * (v16 & 0x3F);
5139 }
5140 if ( (signed int)SkillToMastery(a1) < 2 )
5141 {
5142 v16 = v14;
5143 return v15 * (v16 & 0x3F);
5144 }
5158 v62 = 2; 5145 v62 = 2;
5159 LABEL_31:
5160 v15 = v62; 5146 v15 = v62;
5161 goto LABEL_32; 5147 v16 = v14;
5162 } 5148 return v15 * (v16 & 0x3F);
5163 v20 = (ITEM_EQUIP_TYPE)0; 5149 }
5164 while ( 1 ) 5150 break;
5165 { 5151
5166 if ( v2->HasItemEquipped(v20) ) 5152 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS:
5167 { 5153 {
5168 v22 = this->pInventoryItemList[this->pEquipment.pIndices[v20]].uItemID; 5154 if ( v2->IsUnarmed() )
5169 if ( pItemsTable->pItems[v22].uEquipType <= 1u ) 5155 {
5170 break; 5156 LOBYTE(v18) = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
5171 } 5157 v14 = v18;
5172 v20 = (ITEM_EQUIP_TYPE)((int)v20 + 1); 5158 if ( !v18 )
5173 if ( (signed int)v20 >= 16 ) 5159 return skill_bonus;
5174 return skill_bonus; 5160 v15 = 0;
5175 } 5161 v19 = SkillToMastery(v18);
5176 v71 = (ITEM_EQUIP_TYPE)0; 5162 if ( (signed int)v19 < 3 )
5177 v23 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[v22].uSkillType;
5178 LOBYTE(v24) = v2->GetActualSkillLevel(v23);
5179 v25 = v24;
5180 v26 = SkillToMastery(v24);
5181 if ( !v23 )
5182 {
5183 if ( (signed int)SkillToMastery(v25) >= 4 )
5184 {
5185 LOBYTE(v31) = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
5186 LOBYTE(v25) = v31;
5187 if ( v31 )
5188 { 5163 {
5189 v15 = 0; 5164 if ( (signed int)v19 >= 2 )
5190 v32 = SkillToMastery(v31); 5165 v15 = 1;
5191 if ( (signed int)v32 < 3 ) 5166 v16 = v14;
5192 {
5193 if ( (signed int)v32 >= 2 )
5194 v15 = 1;
5195 }
5196 else
5197 {
5198 v15 = 2;
5199 }
5200 v16 = v25;
5201 return v15 * (v16 & 0x3F); 5167 return v15 * (v16 & 0x3F);
5202 } 5168 }
5203 } 5169 v62 = 2;
5204 goto LABEL_55; 5170 v15 = v62;
5205 } 5171 v16 = v14;
5206 if ( v23 == PLAYER_SKILL_DAGGER ) 5172 return v15 * (v16 & 0x3F);
5207 { 5173 }
5208 v29 = SkillToMastery(v25); 5174 v20 = (ITEM_EQUIP_TYPE)0;
5209 v28 = __OFSUB__(v29, 4); 5175 while ( 1 )
5210 v27 = ((v29 - 4) & 0x80000000u) != 0; 5176 {
5211 } 5177 if ( v2->HasItemEquipped(v20) )
5212 else
5213 {
5214 if ( v23 <= PLAYER_SKILL_DAGGER )
5215 goto LABEL_55;
5216 if ( v23 > PLAYER_SKILL_SPEAR )
5217 {
5218 if ( v23 == PLAYER_SKILL_MACE )
5219 { 5178 {
5220 v28 = __OFSUB__(v26, 2); 5179 v22 = this->pInventoryItemList[this->pEquipment.pIndices[v20]].uItemID;
5221 v27 = v26 - 2 < 0; 5180 if ( pItemsTable->pItems[v22].uEquipType <= 1u )
5222 goto LABEL_53; 5181 break;
5223 } 5182 }
5224 LABEL_55: 5183 v20 = (ITEM_EQUIP_TYPE)((int)v20 + 1);
5184 if ( (signed int)v20 >= 16 )
5185 return skill_bonus;
5186 }
5187 v71 = (ITEM_EQUIP_TYPE)0;
5188 v23 = (PLAYER_SKILL_TYPE)pItemsTable->pItems[v22].uSkillType;
5189 LOBYTE(v24) = v2->GetActualSkillLevel(v23);
5190 v25 = v24;
5191 v26 = SkillToMastery(v24);
5192 if ( v23 == PLAYER_SKILL_STAFF)
5193 {
5194 if ( (signed int)SkillToMastery(v25) >= 4 )
5195 {
5196 LOBYTE(v31) = v2->GetActualSkillLevel(PLAYER_SKILL_UNARMED);
5197 LOBYTE(v25) = v31;
5198 if ( v31 )
5199 {
5200 v15 = 0;
5201 v32 = SkillToMastery(v31);
5202 if ( (signed int)v32 < 3 )
5203 {
5204 if ( (signed int)v32 >= 2 )
5205 v15 = 1;
5206 }
5207 else
5208 {
5209 v15 = 2;
5210 }
5211 v16 = v25;
5212 return v15 * (v16 & 0x3F);
5213 }
5214 }
5225 v30 = v71 * (v25 & 0x3F); 5215 v30 = v71 * (v25 & 0x3F);
5226 return (int)((char *)v69 + v30); 5216 return arm_bonus + v30;
5227 } 5217 }
5228 v28 = __OFSUB__(v26, 3); 5218 if ( v23 == PLAYER_SKILL_DAGGER )
5229 v27 = v26 - 3 < 0; 5219 {
5230 } 5220 v29 = SkillToMastery(v25);
5231 LABEL_53: 5221 v28 = __OFSUB__(v29, 4);
5232 if ( !(v27 ^ v28) ) 5222 v27 = ((v29 - 4) & 0x80000000u) != 0;
5233 v71 = (ITEM_EQUIP_TYPE)1; 5223 }
5234 goto LABEL_55; 5224 else
5225 {
5226 if ( v23 <= PLAYER_SKILL_DAGGER )
5227 {
5228 v30 = v71 * (v25 & 0x3F);
5229 return arm_bonus + v30;
5230 }
5231 if ( v23 > PLAYER_SKILL_SPEAR )
5232 {
5233 if ( v23 == PLAYER_SKILL_MACE )
5234 {
5235 v28 = __OFSUB__(v26, 2);
5236 v27 = v26 - 2 < 0;
5237 if ( !(v27 ^ v28) )
5238 v71 = (ITEM_EQUIP_TYPE)1;
5239 v30 = v71 * (v25 & 0x3F);
5240 return arm_bonus + v30;
5241 }
5242 v30 = v71 * (v25 & 0x3F);
5243 return arm_bonus + v30;
5244 }
5245 v28 = __OFSUB__(v26, 3);
5246 v27 = v26 - 3 < 0;
5247 }
5248 if ( !(v27 ^ v28) )
5249 v71 = (ITEM_EQUIP_TYPE)1;
5250 v30 = v71 * (v25 & 0x3F);
5251 return arm_bonus + v30;
5252 }
5253 default:
5254 return 0;
5235 } 5255 }
5236 5256
5237
5238 assert(false && "Unknown attribute!");
5239 return 0;
5240 } 5257 }
5241 5258
5242 //----- (00490109) -------------------------------------------------------- 5259 //----- (00490109) --------------------------------------------------------
5243 // faces are: 0 1 2 3 human males 5260 // faces are: 0 1 2 3 human males
5244 // 4 5 6 7 human females 5261 // 4 5 6 7 human females