comparison Player.cpp @ 1827:0c75c3e7e436

cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
author Grumpy7
date Fri, 11 Oct 2013 05:49:39 +0200
parents bdac32c645c5
children 35c1e4ff6ba7
comparison
equal deleted inserted replaced
1826:bdac32c645c5 1827:0c75c3e7e436
1182 1182
1183 v2 = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); 1183 v2 = GetActualSkillLevel(PLAYER_SKILL_MERCHANT);
1184 if ( SkillToMastery(v2) >= 4 ) 1184 if ( SkillToMastery(v2) >= 4 )
1185 return 10000; 1185 return 10000;
1186 1186
1187 v7 = GetPartyReputation(); 1187 v7 = pParty->GetPartyReputation();
1188 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); 1188 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5);
1189 v5 = multiplier * (v2 & 0x3F); 1189 v5 = multiplier * (v2 & 0x3F);
1190 if (v5 == 0) 1190 if (v5 == 0)
1191 { 1191 {
1192 return -v7; 1192 return -v7;
2934 { 2934 {
2935 int v3; // qax@1 2935 int v3; // qax@1
2936 2936
2937 v3 = (int)(dt * GetSpecialItemBonus(17) * 0.01 + dt); 2937 v3 = (int)(dt * GetSpecialItemBonus(17) * 0.01 + dt);
2938 2938
2939 Log::Warning(L"Recover(dt = %u/%u - %u", dt, (uint)v3, (uint)uTimeToRecovery); 2939 //Log::Warning(L"Recover(dt = %u/%u - %u", dt, (uint)v3, (uint)uTimeToRecovery);
2940 2940
2941 if (uTimeToRecovery > v3) 2941 if (uTimeToRecovery > v3)
2942 { 2942 {
2943 uTimeToRecovery -= v3; 2943 uTimeToRecovery -= v3;
2944 return true; 2944 return true;
4230 case 5: 4230 case 5:
4231 statToChange = &this->uSpeed; 4231 statToChange = &this->uSpeed;
4232 break; 4232 break;
4233 case 6: 4233 case 6:
4234 statToChange = &this->uLuck; 4234 statToChange = &this->uLuck;
4235 break;
4235 default: 4236 default:
4236 Error("(%u)", eAttribute); 4237 Error("(%u)", eAttribute);
4238 break;
4237 } 4239 }
4238 if ( *statToChange < baseValue ) 4240 if ( *statToChange < baseValue )
4239 { 4241 {
4240 tmp = baseStep; 4242 tmp = baseStep;
4241 baseStep = droppedStep; 4243 baseStep = droppedStep;
7401 } 7403 }
7402 Actor::Die(uActorID); 7404 Actor::Die(uActorID);
7403 Actor::ApplyFineForKillingPeasant(uActorID); 7405 Actor::ApplyFineForKillingPeasant(uActorID);
7404 Actor::AggroSurroundingPeasants(uActorID, 1); 7406 Actor::AggroSurroundingPeasants(uActorID, 1);
7405 if ( actorPtr->pMonsterInfo.uExp ) 7407 if ( actorPtr->pMonsterInfo.uExp )
7406 GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp); 7408 pParty->GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp);
7407 int speechToPlay = SPEECH_51; 7409 int speechToPlay = SPEECH_51;
7408 if ( rand() % 100 < 20 ) 7410 if ( rand() % 100 < 20 )
7409 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1; 7411 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1;
7410 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0); 7412 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0);
7411 } 7413 }
7593 } 7595 }
7594 Actor::Die(uActorID); 7596 Actor::Die(uActorID);
7595 Actor::ApplyFineForKillingPeasant(uActorID); 7597 Actor::ApplyFineForKillingPeasant(uActorID);
7596 Actor::AggroSurroundingPeasants(uActorID, 1); 7598 Actor::AggroSurroundingPeasants(uActorID, 1);
7597 if ( actorPtr->pMonsterInfo.uExp ) 7599 if ( actorPtr->pMonsterInfo.uExp )
7598 GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp); 7600 pParty->GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp);
7599 int speechToPlay = SPEECH_51; 7601 int speechToPlay = SPEECH_51;
7600 if ( rand() % 100 < 20 ) 7602 if ( rand() % 100 < 20 )
7601 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1; 7603 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1;
7602 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0); 7604 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0);
7603 } 7605 }
7974 uPlayerIdx = 1; 7976 uPlayerIdx = 1;
7975 else if ( this == pPlayers[3] ) 7977 else if ( this == pPlayers[3] )
7976 uPlayerIdx = 2; 7978 uPlayerIdx = 2;
7977 else if ( this == pPlayers[4] ) 7979 else if ( this == pPlayers[4] )
7978 uPlayerIdx = 3; 7980 uPlayerIdx = 3;
7979 Error("Unexpected player pointer"); 7981 else
7982 Error("Unexpected player pointer");
7980 return uPlayerIdx; 7983 return uPlayerIdx;
7981 } 7984 }