comparison Player.cpp @ 1387:297b6f192232

Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
author Grumpy7
date Wed, 17 Jul 2013 00:29:58 +0200
parents 72191abc8116
children 60d4885eb107
comparison
equal deleted inserted replaced
1386:72191abc8116 1387:297b6f192232
878 878
879 //----- (00492600) -------------------------------------------------------- 879 //----- (00492600) --------------------------------------------------------
880 int Player::CreateItemInInventory(unsigned int uSlot, unsigned int uItemID) 880 int Player::CreateItemInInventory(unsigned int uSlot, unsigned int uItemID)
881 { 881 {
882 int result; // eax@8 882 int result; // eax@8
883 Texture *texturePtr; // esi@10
884 int *v9; // esi@13
885 unsigned int widthInSlots; // [sp+0h] [bp-Ch]@10
886 signed int freeSlot; // [sp+8h] [bp-4h]@4 883 signed int freeSlot; // [sp+8h] [bp-4h]@4
887 unsigned int heightInSlots; // [sp+18h] [bp+Ch]@10
888 884
889 freeSlot = FindFreeInventoryListSlot(); 885 freeSlot = FindFreeInventoryListSlot();
890 if ( freeSlot == -1 ) 886 if ( freeSlot == -1 )
891 { 887 {
892 if ( uActiveCharacter ) 888 if ( uActiveCharacter )
904 // 506128: using guessed type int areWeLoadingTexture; 900 // 506128: using guessed type int areWeLoadingTexture;
905 901
906 //----- (00492700) -------------------------------------------------------- 902 //----- (00492700) --------------------------------------------------------
907 int Player::HasSkill(unsigned int uSkillType) 903 int Player::HasSkill(unsigned int uSkillType)
908 { 904 {
909 signed int result; // eax@3
910
911 if ( uSkillType >= 37 || this->pActiveSkills[uSkillType] ) 905 if ( uSkillType >= 37 || this->pActiveSkills[uSkillType] )
912 { 906 {
913 return 1; 907 return 1;
914 } 908 }
915 else 909 else
999 //----- (0049289C) -------------------------------------------------------- 993 //----- (0049289C) --------------------------------------------------------
1000 int Player::CreateItemInInventory2( unsigned int index, ItemGen *Src ) 994 int Player::CreateItemInInventory2( unsigned int index, ItemGen *Src )
1001 { 995 {
1002 signed int freeSlot; // ebx@1 996 signed int freeSlot; // ebx@1
1003 int result; // eax@6 997 int result; // eax@6
1004 Texture *item_texture; // esi@7
1005 int *pInvPos; // esi@10
1006 unsigned int slot_width; // [sp+4h] [bp-Ch]@7
1007 unsigned int slot_height; // [sp+8h] [bp-8h]@7
1008
1009 998
1010 freeSlot = FindFreeInventoryListSlot(); 999 freeSlot = FindFreeInventoryListSlot();
1011 if ( freeSlot == -1 ) 1000 if ( freeSlot == -1 )
1012 { 1001 {
1013 result = 0; 1002 result = 0;
1098 equipType = pItemsTable->pItems[idemId].uEquipType; 1087 equipType = pItemsTable->pItems[idemId].uEquipType;
1099 itemValue = pItem->GetValue(); 1088 itemValue = pItem->GetValue();
1100 1089
1101 switch (building_type) 1090 switch (building_type)
1102 { 1091 {
1103 case 1: 1092 case BildingType_WeaponShop:
1104 if (idemId >= 529) 1093 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS)
1105 return 5; 1094 return 5;
1106 if (equipType > 2) 1095 if (equipType > EQUIP_BOW)
1107 return 4; 1096 return 4;
1108 break; 1097 break;
1109 case 2: 1098 case BildingType_ArmorShop:
1110 if (idemId >= 529) 1099 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS)
1111 return 5; 1100 return 5;
1112 if ( equipType < 3 || equipType > 9) 1101 if ( equipType < EQUIP_ARMOUR || equipType > EQUIP_BOOTS)
1113 return 4; 1102 return 4;
1114 break; 1103 break;
1115 case 3: 1104 case BildingType_MagicShop:
1116 if (idemId >= 529) 1105 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS)
1117 return 5; 1106 return 5;
1118 if ( pItemsTable->pItems[idemId].uSkillType != 38 ) 1107 if ( pItemsTable->pItems[idemId].uSkillType != PLAYER_SKILL_MISC )
1119 return 4; 1108 return 4;
1120 break; 1109 break;
1121 case 4: 1110 case BildingType_AlchemistShop:
1122 if ((idemId >= 529 && idemId < 740) || idemId > 771) 1111 if ((idemId >= ITEM_ARTIFACT_HERMES_SANDALS && idemId < ITEM_RECIPE_REJUVENATION) || idemId > ITEM_RECIPE_BODY_RESISTANCE)
1123 return 5; 1112 return 5;
1124 if ( !(equipType == 13 || equipType == 14 || equipType == 17)) 1113 if ( !(equipType == EQUIP_REAGENT || equipType == EQUIP_POTION || equipType == EQUIP_MESSAGE_SCROLL))
1125 return 4; 1114 return 4;
1115 break;
1116 default:
1117 assert(false);
1126 break; 1118 break;
1127 } 1119 }
1128 if (pItem->Stolen()) 1120 if (pItem->Stolen())
1129 return 6; 1121 return 6;
1130 1122
1143 case 4: 1135 case 4:
1144 price = this->GetPriceIdentification(multiplier); 1136 price = this->GetPriceIdentification(multiplier);
1145 break; 1137 break;
1146 case 5: 1138 case 5:
1147 price = this->GetPriceRepair(itemValue, multiplier); 1139 price = this->GetPriceRepair(itemValue, multiplier);
1140 break;
1141 default:
1142 assert(false);
1148 break; 1143 break;
1149 } 1144 }
1150 if ( merchantLevel ) 1145 if ( merchantLevel )
1151 { 1146 {
1152 if (price == itemValue) 1147 if (price == itemValue)