Mercurial > mm7
comparison Player.cpp @ 1167:15ad868d972f
pPartyBuffs - change plain numbers to enums
author | Grumpy7 |
---|---|
date | Tue, 04 Jun 2013 18:29:35 +0200 |
parents | 29a8defbad9e |
children | 8c02e6f74b29 |
comparison
equal
deleted
inserted
replaced
1166:11cda4934da3 | 1167:15ad868d972f |
---|---|
1077 { | 1077 { |
1078 case Condition_Cursed: | 1078 case Condition_Cursed: |
1079 PlaySound((PlayerSpeech)30, 0); | 1079 PlaySound((PlayerSpeech)30, 0); |
1080 break; | 1080 break; |
1081 case Condition_Weak: | 1081 case Condition_Weak: |
1082 if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 ) | 1082 if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0 ) |
1083 {--pParty->pPartyBuffs[13].uPower; | 1083 {--pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower; |
1084 if ( pParty->pPartyBuffs[13].uPower < 1u ) | 1084 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u ) |
1085 pParty->pPartyBuffs[13].Reset(); | 1085 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset(); |
1086 return 0; | 1086 return 0; |
1087 } | 1087 } |
1088 | 1088 |
1089 PlaySound((PlayerSpeech)25, 0); | 1089 PlaySound((PlayerSpeech)25, 0); |
1090 break; | 1090 break; |
1113 case Condition_Poison1: | 1113 case Condition_Poison1: |
1114 case Condition_Poison2: | 1114 case Condition_Poison2: |
1115 case Condition_Poison3: | 1115 case Condition_Poison3: |
1116 if ( a3 == 1 ) | 1116 if ( a3 == 1 ) |
1117 { | 1117 { |
1118 if ( (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 ) | 1118 if ( (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 ) |
1119 { | 1119 { |
1120 --pParty->pPartyBuffs[13].uPower; | 1120 --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower; |
1121 if ( pParty->pPartyBuffs[13].uPower < 1u ) | 1121 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u ) |
1122 pParty->pPartyBuffs[13].Reset(); | 1122 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset(); |
1123 } | 1123 } |
1124 if ( HasEnchantedItemEquipped(21) | 1124 if ( HasEnchantedItemEquipped(21) |
1125 || WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) | 1125 || WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) |
1126 || WearsItem(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK) ) | 1126 || WearsItem(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK) ) |
1127 //goto LABEL_76; | 1127 //goto LABEL_76; |
1135 case Condition_Disease1: | 1135 case Condition_Disease1: |
1136 case Condition_Disease2: | 1136 case Condition_Disease2: |
1137 case Condition_Disease3: | 1137 case Condition_Disease3: |
1138 if ( a3 == 1 ) | 1138 if ( a3 == 1 ) |
1139 { | 1139 { |
1140 if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 ) | 1140 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 ) |
1141 { | 1141 { |
1142 --pParty->pPartyBuffs[13].uPower; | 1142 --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower; |
1143 if ( pParty->pPartyBuffs[13].uPower < 1u ) | 1143 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u ) |
1144 pParty->pPartyBuffs[13].Reset(); | 1144 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset(); |
1145 return 0; | 1145 return 0; |
1146 } | 1146 } |
1147 | 1147 |
1148 if ( HasEnchantedItemEquipped(18) || | 1148 if ( HasEnchantedItemEquipped(18) || |
1149 WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) || | 1149 WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) || |
1153 PlaySound((PlayerSpeech)28, 0); | 1153 PlaySound((PlayerSpeech)28, 0); |
1154 break; | 1154 break; |
1155 case Condition_Paralyzed: | 1155 case Condition_Paralyzed: |
1156 if ( a3 == 1 ) | 1156 if ( a3 == 1 ) |
1157 { | 1157 { |
1158 if ( pParty->pPartyBuffs[13].uExpireTime > 0i64 ) | 1158 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 ) |
1159 { | 1159 { |
1160 --pParty->pPartyBuffs[13].uPower; | 1160 --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower; |
1161 if ( pParty->pPartyBuffs[13].uPower < 1u ) | 1161 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u ) |
1162 pParty->pPartyBuffs[13].Reset(); | 1162 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset(); |
1163 return 0; | 1163 return 0; |
1164 } | 1164 } |
1165 | 1165 |
1166 if ( HasEnchantedItemEquipped(20)|| | 1166 if ( HasEnchantedItemEquipped(20)|| |
1167 WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR)|| | 1167 WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR)|| |
1174 PlaySound(SPEECH_32, 0); | 1174 PlaySound(SPEECH_32, 0); |
1175 if ( sHealth > 0 ) | 1175 if ( sHealth > 0 ) |
1176 sHealth = 0; | 1176 sHealth = 0; |
1177 break; | 1177 break; |
1178 case Condition_Dead: | 1178 case Condition_Dead: |
1179 if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0i64 && pParty->pPartyBuffs[13].uSkill >= 4u ) | 1179 if ( a3 == 1 && (signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64 && pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uSkill >= 4u ) |
1180 { | 1180 { |
1181 --pParty->pPartyBuffs[13].uPower; | 1181 --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower; |
1182 if ( pParty->pPartyBuffs[13].uPower < 1u ) | 1182 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u ) |
1183 pParty->pPartyBuffs[13].Reset(); | 1183 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset(); |
1184 } | 1184 } |
1185 | 1185 |
1186 PlaySound((PlayerSpeech)33, 0); | 1186 PlaySound((PlayerSpeech)33, 0); |
1187 if ( sHealth > 0 ) | 1187 if ( sHealth > 0 ) |
1188 sHealth = 0; | 1188 sHealth = 0; |
1189 if ( sMana > 0 ) | 1189 if ( sMana > 0 ) |
1190 sMana = 0; | 1190 sMana = 0; |
1191 break; | 1191 break; |
1192 case Condition_Pertified: | 1192 case Condition_Pertified: |
1193 if ( a3 == 1 | 1193 if ( a3 == 1 |
1194 &&((pParty->pPartyBuffs[13].uExpireTime > 0i64) | 1194 &&((pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0i64) |
1195 || HasEnchantedItemEquipped(23)|| | 1195 || HasEnchantedItemEquipped(23)|| |
1196 WearsItem(ITEM_RELIC_KELEBRIM, EQIUP_ANY) || | 1196 WearsItem(ITEM_RELIC_KELEBRIM, EQIUP_ANY) || |
1197 WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) || | 1197 WearsItem(ITEM_ARTIFACT_YORUBA, EQUIP_ARMOUR) || |
1198 WearsItem(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK)) ) | 1198 WearsItem(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, EQUIP_CLOAK)) ) |
1199 | 1199 |
1200 return 0; | 1200 return 0; |
1201 PlaySound((PlayerSpeech)34, 0); | 1201 PlaySound((PlayerSpeech)34, 0); |
1202 break; | 1202 break; |
1203 case Condition_Eradicated: | 1203 case Condition_Eradicated: |
1204 if ( a3 == 1 && ((signed __int64)pParty->pPartyBuffs[13].uExpireTime > 0 )&&( pParty->pPartyBuffs[13].uSkill >= 4u )) | 1204 if ( a3 == 1 && ((signed __int64)pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uExpireTime > 0 )&&( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uSkill >= 4u )) |
1205 { | 1205 { |
1206 --pParty->pPartyBuffs[13].uPower; | 1206 --pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower; |
1207 if ( pParty->pPartyBuffs[13].uPower < 1u ) | 1207 if ( pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].uPower < 1u ) |
1208 pParty->pPartyBuffs[13].Reset(); | 1208 pParty->pPartyBuffs[PARTY_BUFF_PROTECTION_FROM_MAGIC].Reset(); |
1209 return 0; | 1209 return 0; |
1210 } | 1210 } |
1211 PlaySound(SPEECH_35, 0); | 1211 PlaySound(SPEECH_35, 0); |
1212 if (sHealth > 0 ) | 1212 if (sHealth > 0 ) |
1213 sHealth = 0; | 1213 sHealth = 0; |
5335 { | 5335 { |
5336 switch ( a2 ) | 5336 switch ( a2 ) |
5337 { | 5337 { |
5338 case CHARACTER_ATTRIBUTE_RESIST_BODY: | 5338 case CHARACTER_ATTRIBUTE_RESIST_BODY: |
5339 v3 = this->pPlayerBuffs[2].uPower; | 5339 v3 = this->pPlayerBuffs[2].uPower; |
5340 v4 = pParty->pPartyBuffs[1].uPower; | 5340 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower; |
5341 break; | 5341 break; |
5342 case CHARACTER_ATTRIBUTE_RESIST_AIR: | 5342 case CHARACTER_ATTRIBUTE_RESIST_AIR: |
5343 v3 = this->pPlayerBuffs[0].uPower; | 5343 v3 = this->pPlayerBuffs[0].uPower; |
5344 v4 = pParty->pPartyBuffs[0].uPower; | 5344 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower; |
5345 break; | 5345 break; |
5346 case CHARACTER_ATTRIBUTE_RESIST_WATER: | 5346 case CHARACTER_ATTRIBUTE_RESIST_WATER: |
5347 v3 = this->pPlayerBuffs[22].uPower; | 5347 v3 = this->pPlayerBuffs[22].uPower; |
5348 v4 = pParty->pPartyBuffs[17].uPower; | 5348 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower; |
5349 break; | 5349 break; |
5350 case CHARACTER_ATTRIBUTE_RESIST_EARTH: | 5350 case CHARACTER_ATTRIBUTE_RESIST_EARTH: |
5351 v3 = this->pPlayerBuffs[3].uPower; | 5351 v3 = this->pPlayerBuffs[3].uPower; |
5352 v4 = pParty->pPartyBuffs[4].uPower; | 5352 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower; |
5353 break; | 5353 break; |
5354 default: | 5354 default: |
5355 if ( a2 != 14 ) | 5355 if ( a2 != 14 ) |
5356 return result; | 5356 return result; |
5357 v3 = this->pPlayerBuffs[9].uPower; | 5357 v3 = this->pPlayerBuffs[9].uPower; |
5358 v4 = pParty->pPartyBuffs[12].uPower; | 5358 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower; |
5359 break; | 5359 break; |
5360 } | 5360 } |
5361 return v4 + v3; | 5361 return v4 + v3; |
5362 } | 5362 } |
5363 if ( a2 != CHARACTER_ATTRIBUTE_ATTACK ) | 5363 if ( a2 != CHARACTER_ATTRIBUTE_ATTACK ) |
5364 { | 5364 { |
5365 if ( a2 == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS ) | 5365 if ( a2 == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS ) |
5366 { | 5366 { |
5367 v3 = this->pPlayerBuffs[8].uPower; | 5367 v3 = this->pPlayerBuffs[8].uPower; |
5368 v4 = pParty->pPartyBuffs[9].uPower; | 5368 v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower; |
5369 return v4 + v3; | 5369 return v4 + v3; |
5370 } | 5370 } |
5371 if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK ) | 5371 if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK ) |
5372 return result; | 5372 return result; |
5373 } | 5373 } |
5374 return this->pPlayerBuffs[1].uPower; | 5374 return this->pPlayerBuffs[1].uPower; |
5375 } | 5375 } |
5376 if ( a2 == 10 ) | 5376 if ( a2 == 10 ) |
5377 { | 5377 { |
5378 v3 = this->pPlayerBuffs[5].uPower; | 5378 v3 = this->pPlayerBuffs[5].uPower; |
5379 v4 = pParty->pPartyBuffs[6].uPower; | 5379 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower; |
5380 return v4 + v3; | 5380 return v4 + v3; |
5381 } | 5381 } |
5382 switch ( a2 ) | 5382 switch ( a2 ) |
5383 { | 5383 { |
5384 case CHARACTER_ATTRIBUTE_STRENGTH: | 5384 case CHARACTER_ATTRIBUTE_STRENGTH: |
5400 v3 = pPlayerBuffs[21].uPower; | 5400 v3 = pPlayerBuffs[21].uPower; |
5401 goto LABEL_5; | 5401 goto LABEL_5; |
5402 case CHARACTER_ATTRIBUTE_LUCK: | 5402 case CHARACTER_ATTRIBUTE_LUCK: |
5403 v3 = pPlayerBuffs[18].uPower; | 5403 v3 = pPlayerBuffs[18].uPower; |
5404 LABEL_5: | 5404 LABEL_5: |
5405 v4 = pParty->pPartyBuffs[2].uPower; | 5405 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
5406 return v4 + v3; | 5406 return v4 + v3; |
5407 case CHARACTER_ATTRIBUTE_AC_BONUS: | 5407 case CHARACTER_ATTRIBUTE_AC_BONUS: |
5408 v3 = this->pPlayerBuffs[14].uPower; | 5408 v3 = this->pPlayerBuffs[14].uPower; |
5409 v4 = pParty->pPartyBuffs[15].uPower; | 5409 v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower; |
5410 return v4 + v3; | 5410 return v4 + v3; |
5411 default: | 5411 default: |
5412 return result; | 5412 return result; |
5413 } | 5413 } |
5414 return result; | 5414 return result; |
7404 if ( VarNum > VAR_AutoNotes ) | 7404 if ( VarNum > VAR_AutoNotes ) |
7405 { | 7405 { |
7406 switch ( VarNum ) | 7406 switch ( VarNum ) |
7407 { | 7407 { |
7408 case VAR_Invisible: | 7408 case VAR_Invisible: |
7409 if ( pParty->pPartyBuffs[11].uExpireTime >0 ) | 7409 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime >0 ) |
7410 return true; | 7410 return true; |
7411 return false; | 7411 return false; |
7412 case VAR_NumDeaths: | 7412 case VAR_NumDeaths: |
7413 v4 = pParty->uNumDeaths; | 7413 v4 = pParty->uNumDeaths; |
7414 return v4 >= pValue; | 7414 return v4 >= pValue; |
7493 case VAR_MonthEquals2: | 7493 case VAR_MonthEquals2: |
7494 v6 = pParty->uCurrentMonth == pValue; | 7494 v6 = pParty->uCurrentMonth == pValue; |
7495 return v6; | 7495 return v6; |
7496 case VAR_IsFlying: | 7496 case VAR_IsFlying: |
7497 if ( pParty->bFlying | 7497 if ( pParty->bFlying |
7498 && (pParty->pPartyBuffs[7].uExpireTime> 0) ) | 7498 && (pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime> 0) ) |
7499 return true; | 7499 return true; |
7500 return false; | 7500 return false; |
7501 case VAR_HiredNPCHasSpeciality: | 7501 case VAR_HiredNPCHasSpeciality: |
7502 LOBYTE(v6) = CheckHiredNPCSpeciality(pValue); | 7502 LOBYTE(v6) = CheckHiredNPCSpeciality(pValue); |
7503 return v6; | 7503 return v6; |