Mercurial > mm7
comparison Player.cpp @ 1547:778916dfa666
Player::GetRangedDamageString fix + some small chnages
author | Grumpy7 |
---|---|
date | Sat, 07 Sep 2013 06:51:56 +0200 |
parents | 5cf28ec7322d |
children | 5a3afcaa6717 |
comparison
equal
deleted
inserted
replaced
1540:6e4980797714 | 1547:778916dfa666 |
---|---|
264 { | 264 { |
265 item_idx = pEquipment.pIndices[i]; | 265 item_idx = pEquipment.pIndices[i]; |
266 if (item_idx) | 266 if (item_idx) |
267 { | 267 { |
268 item_id = pOwnItems[item_idx - 1].uItemID; | 268 item_id = pOwnItems[item_idx - 1].uItemID; |
269 if ( item_id != 64 && item_id != 65 ) //blaster& blaster rifle | 269 if ( item_id != ITEM_BLASTER && item_id != ITEM_LASER_RIFLE ) //blaster& blaster rifle |
270 return false; | 270 return false; |
271 } | 271 } |
272 } | 272 } |
273 return true; | 273 return true; |
274 } | 274 } |
2077 int v6; // edi@4 | 2077 int v6; // edi@4 |
2078 int v7; // edi@4 | 2078 int v7; // edi@4 |
2079 | 2079 |
2080 v1 = this; | 2080 v1 = this; |
2081 v2 = *(int *)&this->pInventoryItemList[this->pEquipment.uMainHand-1]; | 2081 v2 = *(int *)&this->pInventoryItemList[this->pEquipment.uMainHand-1]; |
2082 if ( v2 < 64 || v2 > 65 ) | 2082 if ( v2 < ITEM_BLASTER || v2 > ITEM_LASER_RIFLE ) |
2083 { | 2083 { |
2084 v4 = GetActualAccuracy(); | 2084 v4 = GetActualAccuracy(); |
2085 v5 = GetParameterBonus(v4); | 2085 v5 = GetParameterBonus(v4); |
2086 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK, 0) + v5; | 2086 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK, 0) + v5; |
2087 v7 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v6; | 2087 v7 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v6; |
2227 static char player__getmeleedamagestring_static_buff[40]; // idb | 2227 static char player__getmeleedamagestring_static_buff[40]; // idb |
2228 | 2228 |
2229 if ( pEquipment.uMainHand) | 2229 if ( pEquipment.uMainHand) |
2230 { | 2230 { |
2231 itemid= pOwnItems[this->pEquipment.uMainHand-1].uItemID; | 2231 itemid= pOwnItems[this->pEquipment.uMainHand-1].uItemID; |
2232 if ( itemid < 64 || itemid > 65 ) //blasters | 2232 if ( itemid < ITEM_BLASTER || itemid > ITEM_LASER_RIFLE ) //blasters |
2233 { | 2233 { |
2234 min_damage = GetMeleeDamageMinimal(); | 2234 min_damage = GetMeleeDamageMinimal(); |
2235 max_damage = GetMeleeDamageMaximal(); | 2235 max_damage = GetMeleeDamageMaximal(); |
2236 } | 2236 } |
2237 else | 2237 else |
2271 signed int itemid; // eax@1 | 2271 signed int itemid; // eax@1 |
2272 int min_damage; // edi@3 | 2272 int min_damage; // edi@3 |
2273 int max_damage; // eax@3 | 2273 int max_damage; // eax@3 |
2274 | 2274 |
2275 static char player__getrangeddamagestring_static_buff[40]; // idb | 2275 static char player__getrangeddamagestring_static_buff[40]; // idb |
2276 if ( pEquipment.uMainHand) | 2276 |
2277 { | 2277 if (pEquipment.uMainHand >= 0) |
2278 itemid= pOwnItems[this->pEquipment.uMainHand-1].uItemID; | 2278 { |
2279 if ( itemid < 64 || itemid > 65 ) //blasters | 2279 itemid = pOwnItems[this->pEquipment.uMainHand-1].uItemID; |
2280 { | 2280 } |
2281 min_damage = GetRangedDamageMin(); | 2281 |
2282 max_damage = GetRangedDamageMax(); | 2282 if (pEquipment.uMainHand >= 0 && ( itemid >= 135 ) && ( itemid <= 159 )) |
2283 } | 2283 { |
2284 else | 2284 strcpy(player__getrangeddamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" |
2285 { //for blasters | 2285 return player__getrangeddamagestring_static_buff; |
2286 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 1); | 2286 } |
2287 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 1); | 2287 else if (pEquipment.uMainHand >= 0 && (itemid == ITEM_BLASTER || itemid == ITEM_LASER_RIFLE)) |
2288 } | 2288 { |
2289 if ( max_damage ) | 2289 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 1); |
2290 { | 2290 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 1); |
2291 if ( min_damage == max_damage ) | 2291 } |
2292 { | |
2293 sprintf(player__getrangeddamagestring_static_buff, "%d", min_damage); | |
2294 } | |
2295 else | |
2296 { | |
2297 sprintf(player__getrangeddamagestring_static_buff, "%d - %d", min_damage, max_damage); | |
2298 } | |
2299 } | |
2300 else | |
2301 { | |
2302 strcpy(player__getrangeddamagestring_static_buff, "N/A"); | |
2303 } | |
2304 | |
2305 if (( itemid >= 135 )&&( itemid <= 159 )) //wands | |
2306 { | |
2307 strcpy(player__getrangeddamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" | |
2308 } | |
2309 } | |
2310 else | 2292 else |
2311 strcpy(player__getrangeddamagestring_static_buff, "N/A"); | 2293 { |
2294 min_damage = GetRangedDamageMin(); | |
2295 max_damage = GetRangedDamageMax(); | |
2296 } | |
2297 if ( max_damage > 0) | |
2298 { | |
2299 if ( min_damage == max_damage ) | |
2300 { | |
2301 sprintf(player__getrangeddamagestring_static_buff, "%d", min_damage); | |
2302 } | |
2303 else | |
2304 { | |
2305 sprintf(player__getrangeddamagestring_static_buff, "%d - %d", min_damage, max_damage); | |
2306 } | |
2307 } | |
2308 else | |
2309 { | |
2310 strcpy(player__getrangeddamagestring_static_buff, "N/A"); | |
2311 } | |
2312 return player__getrangeddamagestring_static_buff; | 2312 return player__getrangeddamagestring_static_buff; |
2313 } | 2313 } |
2314 | 2314 |
2315 //----- (0048D45A) -------------------------------------------------------- | 2315 //----- (0048D45A) -------------------------------------------------------- |
2316 bool Player::CanTrainToNextLevel() | 2316 bool Player::CanTrainToNextLevel() |
2317 { | 2317 { |
2318 int v1; // edx@1 | 2318 int v1; // edx@1 |
4852 | 4852 |
4853 for (int j = 0; j < 16; ++j) | 4853 for (int j = 0; j < 16; ++j) |
4854 { | 4854 { |
4855 if (pEquipment.pIndices[j] && (!pOwnItems[pEquipment.pIndices[j]].Broken())) | 4855 if (pEquipment.pIndices[j] && (!pOwnItems[pEquipment.pIndices[j]].Broken())) |
4856 { | 4856 { |
4857 int curr_item = pOwnItems[pEquipment.pIndices[j]].uItemID; | 4857 int curr_item = pOwnItems[pEquipment.pIndices[j] - 1].uItemID; |
4858 PLAYER_SKILL_TYPE itemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[curr_item].uSkillType; | 4858 PLAYER_SKILL_TYPE itemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[curr_item].uSkillType; |
4859 int currArmorSkillLevel = GetActualSkillLevel(itemSkillType); | 4859 int currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
4860 int multiplier = 0; | 4860 int multiplier = 0; |
4861 switch (itemSkillType) | 4861 switch (itemSkillType) |
4862 { | 4862 { |
4911 } | 4911 } |
4912 for (int i = 0; i < 16; ++i) | 4912 for (int i = 0; i < 16; ++i) |
4913 { | 4913 { |
4914 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | 4914 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) |
4915 { | 4915 { |
4916 int currItemIndex = this->pEquipment.pIndices[i] - 1; | 4916 ItemDesc currItem = pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID]; |
4917 if ( pItemsTable->pItems[currItemIndex].uEquipType <= EQUIP_MAIN_HAND) | 4917 if ( currItem.uEquipType <= EQUIP_MAIN_HAND) |
4918 { | 4918 { |
4919 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[currItemIndex].uSkillType; | 4919 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)currItem.uSkillType; |
4920 int currentItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); | 4920 int currentItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); |
4921 if (currItemSkillType == PLAYER_SKILL_BLASTER) | 4921 if (currItemSkillType == PLAYER_SKILL_BLASTER) |
4922 { | 4922 { |
4923 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 2, 3, 5); | 4923 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 2, 3, 5); |
4924 return multiplier * (currentItemSkillLevel & 0x3F); | 4924 return multiplier * (currentItemSkillLevel & 0x3F); |
4946 { | 4946 { |
4947 PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID].uSkillType; | 4947 PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID].uSkillType; |
4948 int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType); | 4948 int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType); |
4949 if ( currentItemSkillType == PLAYER_SKILL_BOW ) | 4949 if ( currentItemSkillType == PLAYER_SKILL_BOW ) |
4950 { | 4950 { |
4951 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 0, 0, 0, 0); | 4951 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 1, 1, 1); |
4952 return multiplier * (currentItemSkillLevel & 0x3F); | 4952 return multiplier * (currentItemSkillLevel & 0x3F); |
4953 } | 4953 } |
4954 else if ( currentItemSkillType == PLAYER_SKILL_BLASTER ) | 4954 else if ( currentItemSkillType == PLAYER_SKILL_BLASTER ) |
4955 { | 4955 { |
4956 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 2, 3, 5); | 4956 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 2, 3, 5); |