Magma_Dragoon
Reploid
- Joined
- May 10, 2008
- Messages
- 2,354
Code:
else if(pCityEspionage->HasReachedGoal(ePlayer))
{
HeistLocation kHeistLocation;
kHeistLocation.m_iX = pCity->getX();
kHeistLocation.m_iY = pCity->getY();
m_aHeistLocations[eCityOwner].push_back(kHeistLocation);
int iSpyResult;
if(pCityEspionage->HasCounterSpy())
{
iSpyResult = GC.getGame().getJonRandNum(300, "Random roll for the result of a spy mission with a counterspy in the city");
int iCounterspyIndex = GET_PLAYER(eCityOwner).GetEspionage()->GetSpyIndexInCity(pCity);
iSpyResult += GET_PLAYER(eCityOwner).GetEspionage()->m_aSpyList[iCounterspyIndex].m_eRank * 30;
iSpyResult *= (100 + GET_PLAYER(pCity->getOwner()).GetPlayerPolicies()->GetNumericModifier(POLICYMOD_CATCH_SPIES_MODIFIER));
iSpyResult /= 100;
if(iSpyResult < 100)
{
pCityEspionage->SetSpyResult(ePlayer, SPY_RESULT_DETECTED);
}
else if(iSpyResult < 200)
{
pCityEspionage->SetSpyResult(ePlayer, SPY_RESULT_IDENTIFIED);
}
else
{
pCityEspionage->SetSpyResult(ePlayer, SPY_RESULT_KILLED);
CvPlayerAI& kCityOwner = GET_PLAYER(eCityOwner);
CvPlayerAI& kSpyOwner = GET_PLAYER(ePlayer);
if( strcmp(kCityOwner.getCivilizationTypeKey(), "CIVILIZATION_RUSSIA") == 0 &&
strcmp(kSpyOwner.getCivilizationTypeKey(), "CIVILIZATION_ENGLAND") == 0)
{
//Do not trigger achievement if we're in the Smokey Skies scenario.
bool bUsingXP1Scenario3 = gDLL->IsModActivated(CIV5_XP1_SCENARIO3_MODID);
if(!bUsingXP1Scenario3)
{
if(eCityOwner == GC.getGame().getActivePlayer())
gDLL->UnlockAchievement(ACHIEVEMENT_XP1_25);
}
}
}
}
else
{
iSpyResult = GC.getGame().getJonRandNum(300, "Random roll for the result of a spying mission without a counterspy in the city");
iSpyResult *= (100 + GET_PLAYER(pCity->getOwner()).GetPlayerPolicies()->GetNumericModifier(POLICYMOD_CATCH_SPIES_MODIFIER));
iSpyResult /= 100;
if(iSpyResult < 100)
{
pCityEspionage->SetSpyResult(ePlayer, SPY_RESULT_UNDETECTED);
}
else if(iSpyResult < 200)
{
pCityEspionage->SetSpyResult(ePlayer, SPY_RESULT_DETECTED);
}
else
{
pCityEspionage->SetSpyResult(ePlayer, SPY_RESULT_IDENTIFIED);
}
}