Exact spying figures (success rates, etc)

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);
				}
			}
 
Thanks MD! I had no idea that tech being stolen goes unnoticed a third of the time! Do you think I have the stats correct in this table?

|none|Level 1|Level 2|Level 3
Chance to Notice|66%|100%|100%|100%
Chance to ID|33%|67%|77%|87%
Chance to kill|0|33%|43%|57%

One thing I did not realize, is that even with NIA, it might be worth a spy in cap. One thing I had figured out is that sparing a spy in cap is a pretty good investment, but it&#8217;s not really justified for that spy to be particularly experienced.
 
I didn't know either until last night. Then again, if the spy isn't detected how would we?

Table odds look right to me.
 
Top Bottom