FANDOM


  • Source File: sp2_world_behavior

Line(s) Edited: 1403-1405


code: { const REAL32 PourcAverageEconomy = 0.2f; const REAL32 PourcEconomicHealth = 0.6f; const REAL32 PourcHumanDevelopment = 0.2f; REAL32 l_fAverageEconomy = 0.f; REAL32 l_fEconomicHealth = 0.f; REAL32 l_fResults = 0.f; //The poverty is calculated compared to the stronger economy, and with the economic health REAL64 l_fAverageGDPPerCapita = 0.f; UINT32 l_iNbCountries = (UINT32)g_ServerDAL.NbCountry(); UINT32 l_iNbActiveCountries = 0; //Find strongest economy for(UINT32 i=1; i<= l_iNbCountries; i++) { GCountryData* l_pCountryData = g_ServerDAL.CountryData(i); if(!l_pCountryData->Activated()) continue; l_fAverageGDPPerCapita += l_pCountryData->GDPValueBase() / (REAL64)( max(1,l_pCountryData->Pop1565()) ); l_iNbActiveCountries++; } if(l_iNbActiveCountries == 0) return false; l_fAverageGDPPerCapita /= (REAL64)l_iNbActiveCountries; if(( m_CountryData->GDPValueBase() / (REAL64)( max(1,m_CountryData->Pop1565()) ) ) > l_fAverageGDPPerCapita) l_fAverageEconomy = 0.f; else l_fAverageEconomy = 1.f; l_fEconomicHealth = (((1.f-m_CountryData->EconomicHealth()) * m_CountryData->CountryEconomicModel()) * 2.f ) - 1.f; l_fResults = (l_fEconomicHealth * PourcEconomicHealth) + (l_fAverageEconomy * PourcAverageEconomy); l_fResults = 1.f + ( ((l_fResults * 2.f) - 1.f) / 100.f); REAL32 l_fNewPoverty = m_CountryData->PopInPoverty(); l_fNewPoverty += (((l_fNewPoverty * l_fResults) - l_fNewPoverty) * m_fFrequency); if(l_fNewPoverty > 0.9f) l_fNewPoverty = 0.9f; else if(l_fNewPoverty < 0.02f) l_fNewPoverty = 0.02f; m_CountryData->PopInPoverty(l_fNewPoverty); return true; }

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.