|
From: <imp...@us...> - 2007-03-13 05:07:22
|
Revision: 41
http://civ4ccp.svn.sourceforge.net/civ4ccp/?rev=41&view=rev
Author: impalerwrg
Date: 2007-03-12 22:07:20 -0700 (Mon, 12 Mar 2007)
Log Message:
-----------
Incremental TR merger, cleaned up comments
Modified Paths:
--------------
CvGameCoreDLL/CvCity.cpp
CvGameCoreDLL/CvCity.h
CvGameCoreDLL/CvGame.cpp
CvGameCoreDLL/CvGameCoreDLL.depend
CvGameCoreDLL/CvGameTextMgr.cpp
CvGameCoreDLL/CvGlobals.cpp
CvGameCoreDLL/CvMapGenerator.cpp
CvGameCoreDLL/CvMapGenerator.h
CvGameCoreDLL/CvPlayer.cpp
CvGameCoreDLL/CvPlotGroup.cpp
CvGameCoreDLL/CvUnit.h
Modified: CvGameCoreDLL/CvCity.cpp
===================================================================
--- CvGameCoreDLL/CvCity.cpp 2007-03-12 21:52:58 UTC (rev 40)
+++ CvGameCoreDLL/CvCity.cpp 2007-03-13 05:07:20 UTC (rev 41)
@@ -94,6 +94,7 @@
m_aiStateReligionCommerceRateModifier = new int[NUM_COMMERCE_TYPES]; // CivicsBalance by AussieLurker
m_aiNonStateReligionCommerceRateModifier = new int[NUM_COMMERCE_TYPES]; // CivicsBalance by AussieLurker
+ m_paiBuildingOriginalTurn = NULL;
CvDLLEntity::createCityEntity(this); // create and attach entity to city
@@ -205,10 +206,10 @@
pPlot->changeAdjacentSight((TeamTypes)iI, GC.getDefineINT("PLOT_VISIBILITY_RANGE"), true, NO_INVISIBLE);
}
}
- // Mongoose FloodPlainsFix Start
+ // < FloodPlainsFix by Mongoose Start >
// ORGINAL CODE if (pPlot->getFeatureType() != NO_FEATURE)
if ((pPlot->getFeatureType() != NO_FEATURE) && (pPlot->getFeatureType() != (FeatureTypes)GC.getInfoTypeForString("FEATURE_FLOOD_PLAINS")))
- // Mongoose FloodPlainsFix End
+ // < FloodPlainsFix End >
{
pPlot->setFeatureType(NO_FEATURE);
}
@@ -322,7 +323,9 @@
SAFE_DELETE_ARRAY(m_paTradeCities);
- //Addition LocalSpecialistYieldChanges by Impaler[WrG]
+ //--------------------------CCCP NEW-----------------------------------
+
+ // < Local Specialist Yield Changes by Impaler[WrG] Start >
int iI;
if (m_ppaaiLocalSpecialistExtraYield != NULL)
{
@@ -332,9 +335,9 @@
}
SAFE_DELETE_ARRAY(m_ppaaiLocalSpecialistExtraYield);
}
- //End
+ // End
- //Start Addition LocalSpecialistCommerceChange by Impaler[WrG]
+ // < Local Specialist Commerce Changes by Impaler[WrG] Start >
if (m_ppaaiLocalSpecialistExtraCommerce != NULL)
{
for (iI = 0; iI < GC.getNumSpecialistInfos(); iI++)
@@ -343,9 +346,10 @@
}
SAFE_DELETE_ARRAY(m_ppaaiLocalSpecialistExtraCommerce);
}
- //End
+ // End
SAFE_DELETE_ARRAY(m_paiBuildingOutputBonuses); // Building Resource Converter by Lopez
+ SAFE_DELETE_ARRAY(m_paiBuildingOriginalTurn); // Timer support by Mexico
m_orderQueue.clear();
}
@@ -442,6 +446,7 @@
m_iReligionGoodHealth = 0;
m_iReligionBadHealth = 0;
// Changes End
+ m_iPandemicTurns = 0; // Pandemic system by Mexico - Start
m_bNeverLost = true;
m_bBombarded = false;
@@ -555,6 +560,10 @@
m_paiBuildingOriginalTime[iI] = MIN_INT;
m_pabHasRealBuilding[iI] = false;
m_pabFreeBuilding[iI] = false;
+
+ // Timer support by Mexico
+ m_paiBuildingOriginalTurn[iI] = 0;
+ // End of timer support
}
FAssertMsg((0 < GC.getNumUnitInfos()), "GC.getNumUnitInfos() is not greater than zero but an array is being allocated in CvCity::reset");
@@ -618,6 +627,8 @@
m_aiNonStateReligionCommerceRateModifier = new int[GC.getNumReligionInfos()]; // CivicsBalancer by AussieLurker
// Changes End
+ m_paiBuildingOriginalTurn = new int[GC.getNumBuildingInfos()]; // Timer support by Mexico
+
FAssertMsg((0 < GC.getNumReligionInfos()), "GC.getNumReligionInfos() is not greater than zero but an array is being allocated in CvCity::reset");
m_paiReligionInfluence = new int[GC.getNumReligionInfos()];
m_paiStateReligionHappiness = new int[GC.getNumReligionInfos()];
@@ -901,6 +912,10 @@
processBuildingBonuses(); // Building Resorce Conver by Lopez
+ doBuildingTimed();
+
+ doPandemic(); // Pandemic system by Mexico
+
// ONEVENT - Do turn
gDLL->getEventReporterIFace()->cityDoTurn(this, getOwnerINLINE());
@@ -1663,6 +1678,14 @@
}
}
+ // < Prerequiste Civics For Units by Lopez Start >
+ if (GC.getUnitInfo(eUnit).getPrereqCivic() != NO_CIVIC)
+ {
+ if (!(GET_PLAYER(getOwnerINLINE())).isCivic((CivicTypes)(GC.getUnitInfo(eUnit).getPrereqCivic())))
+ return false;
+ }
+ // < Prerequiste Civics For Units End >
+
if (GC.getUnitInfo(eUnit).isPrereqBonuses())
{
if (GC.getUnitInfo(eUnit).getDomainType() == DOMAIN_SEA)
@@ -1738,6 +1761,47 @@
}
}
+ // < BuildingClass Prereq For Units by Mexico Start >
+ bool bRequiresBuilding = false;
+ bool bNeedsBuilding = false;
+ BuildingTypes prereqBuilding = NO_BUILDING;
+
+ for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
+ {
+ if (GC.getUnitInfo(eUnit).isPrereqAndBuilding(iI))
+ {
+ bRequiresBuilding = true;
+ prereqBuilding = ((BuildingTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(iI)));
+ if (!hasBuilding(prereqBuilding))
+ {
+ eSpecialBuilding = ((SpecialBuildingTypes)(GC.getBuildingInfo(prereqBuilding).getSpecialBuildingType()));
+ if ( (eSpecialBuilding == NO_SPECIALBUILDING) || !(GET_PLAYER(getOwnerINLINE()).isSpecialBuildingNotRequired(eSpecialBuilding)))
+ bNeedsBuilding = true;
+ }
+ }
+ }
+
+ if (bRequiresBuilding && bNeedsBuilding)
+ return false;
+
+ bRequiresBuilding = false;
+ bNeedsBuilding = true;
+
+ for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
+ {
+ if (GC.getUnitInfo(eUnit).isPrereqOrBuilding(iI))
+ {
+ bRequiresBuilding = true;
+ prereqBuilding = ((BuildingTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(iI)));
+ if (hasBuilding(prereqBuilding))
+ bNeedsBuilding = false;
+ }
+ }
+
+ if (bRequiresBuilding && bNeedsBuilding)
+ return false;
+ // < BuildingClass Prereq For Units End >
+
if (GC.getUnitInfo(eUnit).getPrereqAndBonus() != NO_BONUS)
{
if (!hasBonus((BonusTypes)GC.getUnitInfo(eUnit).getPrereqAndBonus()))
@@ -1746,7 +1810,28 @@
}
}
+ // < Multi-Bonus Unit Requirement by Mexico Start >
+
bRequiresBonus = false;
+ bNeedsBonus = false;
+
+ for (iI = 0; iI < GC.getNUM_UNIT_PREREQ_OR_BONUSES(); iI++) // TODO check see if And or is backwards here
+ {
+ if (GC.getUnitInfo(eUnit).getPrereqAndBonuses(iI) != NO_BONUS)
+ {
+ bRequiresBonus = true;
+
+ if (!hasBonus((BonusTypes)GC.getUnitInfo(eUnit).getPrereqAndBonuses(iI)))
+ bNeedsBonus = true;
+ }
+ }
+
+ if (bRequiresBonus && bNeedsBonus)
+ return false;
+
+ // < Multi-Bonus Unit Requirement End >
+
+ bRequiresBonus = false;
bNeedsBonus = true;
for (iI = 0; iI < GC.getNUM_UNIT_PREREQ_OR_BONUSES(); iI++)
@@ -3002,10 +3087,10 @@
{
if (hasTrait((TraitTypes)iI))
{
- // Addition New Traits by Impaler[WrG]
+ // < BuildingClass Traits Modifier by Impaler[WrG] Start >
int BuildingClass = GC.getBuildingInfo(eBuilding).getBuildingClassType();
iMultiplier += GC.getTraitInfo((TraitTypes) iI).getBuildingClassProductionModifier(BuildingClass);
- // End Addition by Impaler
+ // < BuildingClass Traits Modifier End >
iMultiplier += GC.getBuildingInfo(eBuilding).getProductionTraits(iI);
@@ -3638,9 +3723,9 @@
changeLocalSpecialistYieldChange(((SpecialistTypes)iI), ((YieldTypes)iJ), (GC.getBuildingInfo(eBuilding).getLocalSpecialistYieldChange(iI, iJ) * iChange));
}
}
- // End Addition by Impaler[WrG]
+ // < Local Specialist Yield Change End >
- // Start Addition LocalSpecialistCommerceChange by Impaler[WrG] 5/16/06
+ // < Local Specialist Commerce Change by Impaler[WrG] Start >
for (iI = 0; iI < GC.getNumSpecialistInfos(); iI++)
{
for (iJ = 0; iJ < NUM_COMMERCE_TYPES; iJ++)
@@ -3648,9 +3733,9 @@
changeLocalSpecialistCommerceChange(((SpecialistTypes)iI), ((CommerceTypes)iJ), (GC.getBuildingInfo(eBuilding).getLocalSpecialistCommerceChange(iI, iJ) * iChange));
}
}
- // End Addition by Impaler[WrG]
+ // < Local Specialist Commerce Change by Impaler[WrG] Start >
- // Start Addition FreeConnections by Impaler[WrG]
+ // < Free Connections by Impaler[WrG] Start >
if (GC.getBuildingInfo(eBuilding).isFreeConnections())
{
if (iChange > 0)
@@ -3658,18 +3743,18 @@
if (iChange < 0)
setFreeConnections(false);
}
- // End Addition by Impaler[WrG]
+ // < Free Connections End >
- // Start Addition OnConstructCommerce by Impaler[WrG]
+ // < OnConstruct Commerce by Impaler[WrG] Start >
if (GC.getBuildingInfo(eBuilding).getOnConstructCommerce(COMMERCE_GOLD) != 0)
GET_PLAYER(getOwnerINLINE()).changeGold(GC.getBuildingInfo(eBuilding).getOnConstructCommerce(COMMERCE_GOLD));
if (GC.getBuildingInfo(eBuilding).getOnConstructCommerce(COMMERCE_RESEARCH) != 0)
GET_TEAM(getTeam()).changeResearchProgress(GET_PLAYER(getOwnerINLINE()).getCurrentResearch(), GC.getBuildingInfo(eBuilding).getOnConstructCommerce(COMMERCE_RESEARCH), getOwnerINLINE());
if (GC.getBuildingInfo(eBuilding).getOnConstructCommerce(COMMERCE_CULTURE) != 0)
changeCulture(getOwnerINLINE(), GC.getBuildingInfo(eBuilding).getOnConstructCommerce(COMMERCE_CULTURE), true);
- // End Addition by Impaler[WrG]
+ // < OnConstruct Commerce End >
- changeSpyDefenceModifier(GC.getBuildingInfo(eBuilding).getSpySuccessModifier()); // Additional Spy Missions by Impaler[WrG]
+ changeSpyDefenceModifier(GC.getBuildingInfo(eBuilding).getSpySuccessModifier()); // < Spy Missions by Impaler[WrG] >
FAssertMsg((0 < GC.getNumBonusInfos()) && "GC.getNumBonusInfos() is not greater than zero but an array is being allocated in CvPlotGroup::reset", "GC.getNumBonusInfos() is not greater than zero but an array is being allocated in CvPlotGroup::reset");
for (iI = 0; iI < GC.getNumBonusInfos(); iI++)
@@ -3765,9 +3850,7 @@
updateBuildingCommerce();
- // < Building Resource Converter Start >
- processBuildingBonuses();
- // < Building Resource Converter End >
+ processBuildingBonuses(); // < Building Resource Converter by Lopez >
setLayoutDirty(true);
}
@@ -3806,21 +3889,21 @@
for (iI = 0; iI < NUM_YIELD_TYPES; iI++)
{
- // StartChange LocalSpecialistYieldChange by Impaler[WrG] 5/16/06
+ // < Local Specialist Yield Change by Impaler[WrG] Start >
// ORIGINAL CODE changeBaseYieldRate(((YieldTypes)iI), (GC.getSpecialistInfo(eSpecialist).getYieldChange(iI) * iChange));
changeBaseYieldRate(((YieldTypes)iI), ((GC.getSpecialistInfo(eSpecialist).getYieldChange(iI) + getLocalSpecialistYieldChange(eSpecialist, YieldTypes(iI))) * iChange));
- // End Change by Impaler[WrG]
+ // < Local Specialist Yield Change End >
}
for (iI = 0; iI < NUM_COMMERCE_TYPES; iI++)
{
- // StartChange LocalSpecialistCommerceChange by Impaler[WrG] 5/1/606
+ // < Local Specialist Commerce Change by Impaler[WrG] Start >
// ORIGINAL CODE changeSpecialistCommerce(((CommerceTypes)iI), (GC.getSpecialistInfo(eSpecialist).getCommerceChange(iI) * iChange));
int BaseCommerce = GC.getSpecialistInfo(eSpecialist).getCommerceChange(iI);
int LocalCommerce = getLocalSpecialistCommerceChange(eSpecialist, CommerceTypes(iI));
int PlayerCommerce = GET_PLAYER(getOwnerINLINE()).getSpecialistTypeExtraCommerce(eSpecialist, CommerceTypes(iI));
changeSpecialistCommerce((CommerceTypes)iI, (BaseCommerce + LocalCommerce + PlayerCommerce) * iChange);
- // End Change by Impaler[WrG]
+ // < Local Specialist Commerce Change End >
}
updateExtraSpecialistYield();
@@ -4196,7 +4279,7 @@
iHappiness += max(0, GC.getHandicapInfo(getHandicapType()).getHappyBonus());
iHappiness += max(0, getVassalHappiness());
- iHappiness += max(0, getCommerceRate(COMMERCE_HAPPY)); // Addition MoreCommerceTypes v1.0 Impaler[WrG]
+ iHappiness += max(0, getCommerceRate(COMMERCE_HAPPY)); // < More CommerceTypes by Impaler[WrG] >
return max(0, iHappiness);
}
@@ -4324,27 +4407,21 @@
iTotalHealth += iHealth;
}
- // Start Addition MoreComereceTypes by Impaler[WrG]
+ // < MoreComereceTypes by Impaler[WrG] Start >
iHealth = getCommerceRate(COMMERCE_HEALTH);
if (iHealth > 0)
- {
iTotalHealth += iHealth;
- }
- // End Addition by Impaler[WrG]
+ // < MoreComereceTypes End >
- // Changes Start
+ // < Civics Balancer by Aussie Lurker Start >
iHealth = GET_PLAYER(getOwnerINLINE()).getStateReligionExtraHealth();
if (iHealth > 0)
- {
iTotalHealth += iHealth;
- }
iHealth = GET_PLAYER(getOwnerINLINE()).getNonStateReligionExtraHealth();
if (iHealth > 0)
- {
iTotalHealth += iHealth;
- }
- // Changes End
+ // < Civics Balancer End >
return iTotalHealth;
}
@@ -4393,19 +4470,15 @@
iTotalHealth += iHealth;
}
- //Changes Start
+ // < Civics Balancer by Aussie Lurker Start >
iHealth = GET_PLAYER(getOwnerINLINE()).getStateReligionExtraHealth();
if (iHealth < 0)
- {
iTotalHealth += iHealth;
- }
iHealth = GET_PLAYER(getOwnerINLINE()).getNonStateReligionExtraHealth();
if (iHealth < 0)
- {
iTotalHealth += iHealth;
- }
- // Changes Start
+ // < Civics Balancer End >
iHealth = GC.getHandicapInfo(getHandicapType()).getHealthBonus();
if (iHealth < 0)
@@ -4489,7 +4562,7 @@
return (getProductionNeeded() - getProduction());
}
-int CvCity::getHurryCostModifier() const
+int CvCity::getHurryCostModifier(bool bIgnoreNew) const
{
int iModifier = 100;
CLLNode<OrderData>* pOrderNode = headOrderQueueNode();
@@ -4499,11 +4572,11 @@
switch (pOrderNode->m_data.eOrderType)
{
case ORDER_TRAIN:
- iModifier = getHurryCostModifier((UnitTypes) pOrderNode->m_data.iData1, false);
+ iModifier = getHurryCostModifier((UnitTypes) pOrderNode->m_data.iData1, bIgnoreNew);
break;
case ORDER_CONSTRUCT:
- iModifier = getHurryCostModifier((BuildingTypes) pOrderNode->m_data.iData1, false);
+ iModifier = getHurryCostModifier((BuildingTypes) pOrderNode->m_data.iData1, bIgnoreNew);
break;
case ORDER_CREATE:
@@ -4680,12 +4753,10 @@
int CvCity::cultureDistance(int iDX, int iDY) const
{
- //Start Change SlowExpandingCulturalBorders by Chalid
+ // < Slow Expanding Cultural Borders by Chalid Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_SLOW_CULTURAL_BORDERS))
- {
return max(1, abs(iDX)+abs(iDY)+max(abs(iDX),abs(iDY))-1);
- }
- // EndChange by Chalid
+ // < Slow Expanding Cultural Borders End >
return max(1, plotDistance(0, 0, iDX, iDY));
}
@@ -5110,7 +5181,7 @@
return m_iBaseGreatPeopleRate;
}
-int CvCity::getLocalGreatPeopleRate() const // Addition GreatPeoplePointPooling by Impaler[WrG]
+int CvCity::getLocalGreatPeopleRate() const // < GreatPeople Point Pooling by Impaler[WrG] >
{
return ((getBaseGreatPeopleRate() * getTotalGreatPeopleRateModifier()) / 100);
}
@@ -5122,10 +5193,10 @@
return 0;
}
- // Start Change GreatPeoplePointPooling by Impaler[WrG] 5/7/06
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
return GET_PLAYER(getOwnerINLINE()).getGreatPeopleRate();
- // End Change by Impaler[WrG] 5/7/06
+ // < GreatPeople Point Pooling End >
return ((getBaseGreatPeopleRate() * getTotalGreatPeopleRateModifier()) / 100);
}
@@ -5153,18 +5224,20 @@
void CvCity::changeBaseGreatPeopleRate(int iChange)
{
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
int OriginalRate = ((getBaseGreatPeopleRate() * getTotalGreatPeopleRateModifier()) / 100); // GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling End >
m_iBaseGreatPeopleRate = (m_iBaseGreatPeopleRate + iChange);
FAssert(getBaseGreatPeopleRate() >= 0);
- // Start Addition GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
int NewRate = ((getBaseGreatPeopleRate() * getTotalGreatPeopleRateModifier()) / 100);
GET_PLAYER(getOwnerINLINE()).changeGreatPeopleRate(NewRate - OriginalRate);
}
- // End Addition by Impaler[WrG]
+ // < GreatPeople Point Pooling End >
}
@@ -5182,23 +5255,21 @@
int CvCity::getGreatPeopleProgress() const
{
- //Start Change GreatPeoplePointPooling by Impaler[WrG] 5/2/06
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
- {
//redirect to the Player Pool of points
return GET_PLAYER(getOwnerINLINE()).getGreatPeopleProgress();
- }
- // End Addition GreatPeoplePointPooling by Impaler[WrG] 5/2/06
+ // < GreatPeople Point Pooling End >
return m_iGreatPeopleProgress;
}
void CvCity::changeGreatPeopleProgress(int iChange)
{
- //Start Change GreatPeoplePointPooling by Impaler[WrG] 5/2/06
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
- //redirect the increese to the player Pool
+ // redirect the increese to the player Pool
GET_PLAYER(getOwnerINLINE()).changeGreatPeopleProgress(iChange);
//FAssert(CvCity.getOwnerINLINE().getGreatPeopleProgress() >= 0);
}
@@ -5207,7 +5278,7 @@
m_iGreatPeopleProgress = (m_iGreatPeopleProgress + iChange);
FAssert(getGreatPeopleProgress() >= 0);
}
- // End Change GreatPeoplePointPooling by Impaler[WrG] 5/2/06
+ // < GreatPeople Point Pooling End >
}
@@ -6764,12 +6835,13 @@
{
m_bWeLoveTheKingDay = bNewValue;
- // Start Addition Improved WLTKD by Impaler[WrG]
+ // < Improved WLTKD by Impaler[WrG] Start >
if (GC.getDefineBOOL("IMPROVED_WLTKD"))
updateYield();
- else
+ else // Original Behavior
+ // < Improved WLTKD End >
+
updateMaintenance();
- // End Addition by Impaler[WrG]
eCivic = NO_CIVIC;
@@ -7118,7 +7190,7 @@
iModifier += GET_PLAYER(getOwnerINLINE()).getYieldRateModifier(eIndex);
- // Changes Start
+ // < Civics Balancer by Aussie Lurker Start >
if (GET_PLAYER(getOwnerINLINE()).getStateReligion() != NO_RELIGION)
{
if (isHasReligion(GET_PLAYER(getOwnerINLINE()).getStateReligion()))
@@ -7130,7 +7202,7 @@
iModifier += getNonStateReligionYieldRateModifier(eIndex);
}
}
- // Changes End
+ // < Civics Balancer End >
if (isCapital())
{
@@ -7145,9 +7217,9 @@
int CvCity::getYieldRate(YieldTypes eIndex) const
{
- // < Changes Start >
+ // < Civics Balancer by Aussie Lurker Start >
return ((getBaseYieldRate(eIndex) * getBaseYieldRateModifier(eIndex)) / 100) + getBuildingYieldChange(eIndex);
- // < Changes End >
+ // < Civics Balancer End >
}
@@ -7391,30 +7463,30 @@
FAssertMsg(eIndex < NUM_YIELD_TYPES, "eIndex expected to be < NUM_YIELD_TYPES");
FAssertMsg(eSpecialist >= 0, "eSpecialist expected to be >= 0");
FAssertMsg(eSpecialist < GC.getNumSpecialistInfos(), "GC.getNumSpecialistInfos expected to be >= 0");
- // Start Change LocalSpecialistYieldChange By Impaler[WrG]
+ // < Local Specialist Yield Change By Impaler[WrG] Start >
// ORIGINAL CODE return ((getSpecialistCount(eSpecialist) + getFreeSpecialistCount(eSpecialist)) * GET_PLAYER(getOwnerINLINE()).getSpecialistExtraYield(eSpecialist, eIndex));
return (getSpecialistCount(eSpecialist) * (GET_PLAYER(getOwnerINLINE()).getSpecialistExtraYield(eSpecialist, eIndex) + getLocalSpecialistYieldChange(eSpecialist, eIndex)));
- // End Change by Impaler[WrG]
+ // < Local Specialist Yield Change End >
}
-int CvCity::getLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eYield) const //Addition LocalSpecialistYieldChange by Impaler[WrG]
+int CvCity::getLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eYield) const // < Local Specialist Yield Change By Impaler[WrG] >
{
return m_ppaaiLocalSpecialistExtraYield[eSpecialist][eYield];
}
-void CvCity::changeLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eYield, int iChange) //Addition LocalSpecialistYieldChange by Impaler[WrG] 5/16/06
+void CvCity::changeLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eYield, int iChange) // < Local Specialist Yield Change By Impaler[WrG] >
{
int iYield = m_ppaaiLocalSpecialistExtraYield[eSpecialist][eYield];
m_ppaaiLocalSpecialistExtraYield[eSpecialist][eYield] = iYield + iChange;
}
-int CvCity::getLocalSpecialistCommerceChange(SpecialistTypes eSpecialist, CommerceTypes eIndex) const //Addition LocalSpecialistCommerceChange by Impaler[WrG] 5/16/06
+int CvCity::getLocalSpecialistCommerceChange(SpecialistTypes eSpecialist, CommerceTypes eIndex) const // < Local Specialist Yield Change By Impaler[WrG] >
{
return m_ppaaiLocalSpecialistExtraCommerce[eSpecialist][eIndex];
}
-void CvCity::changeLocalSpecialistCommerceChange(SpecialistTypes eSpecialist, CommerceTypes eCommerce, int iChange) //Addition LocalSpecialistCommerceChange by Impaler[WrG] 5/16/06
+void CvCity::changeLocalSpecialistCommerceChange(SpecialistTypes eSpecialist, CommerceTypes eCommerce, int iChange) // < Local Specialist Yield Change By Impaler[WrG] >
{
m_ppaaiLocalSpecialistExtraCommerce[eSpecialist][eCommerce] += iChange;
}
@@ -7481,7 +7553,7 @@
if (eIndex == COMMERCE_GOLD)
{
- // Start Change MoreCommerceTypes v1.0 Impaler[WrG] 5/10/06
+ // < MoreCommerce Types by Impaler[WrG] Start >
// ORIGINAL CODE iCommerce += (iYieldRate - iCommerce - getCommerceFromPercent(COMMERCE_RESEARCH, iYieldRate) - getCommerceFromPercent(COMMERCE_CULTURE, iYieldRate));
int notGoldCommerce = 0;
for (int I = 0; I < NUM_YIELD_TYPES; I++){
@@ -7489,7 +7561,7 @@
notGoldCommerce += getCommerceFromPercent(CommerceTypes(I), iYieldRate);
}
iCommerce += (iYieldRate - iCommerce - notGoldCommerce);
- // End Change MoreCommerceTypes v1.0 Impaler[WrG] 5/10/06
+ // < MoreCommerce Types End >
}
return iCommerce;
@@ -8463,15 +8535,15 @@
int CvCity::getGreatPeopleUnitRate(UnitTypes eIndex) const
{
- //Start Change GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
- //redirect to the player function
+ // redirect to the player function
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()");
return GET_PLAYER(getOwnerINLINE()).getGreatPeopleUnitRate(eIndex);
}
- //End Change by Impaler[WrG] 5/7/06
+ // < GreatPeople Point Pooling End >
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()");
@@ -8481,7 +8553,7 @@
void CvCity::setGreatPeopleUnitRate(UnitTypes eIndex, int iNewValue)
{
- //Start Change GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
//redirect to the player function
@@ -8490,14 +8562,14 @@
GET_PLAYER(getOwnerINLINE()).setGreatPeopleUnitRate(eIndex, iNewValue);
FAssert(getGreatPeopleUnitRate(eIndex) >= 0);
}
- else // keep original behavior
+ else // Original Behavior
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()");
m_paiGreatPeopleUnitRate[eIndex] = iNewValue;
FAssert(getGreatPeopleUnitRate(eIndex) >= 0);
}
- //End Change by Impaler[WrG]
+ // < GreatPeople Point Pooling End >
}
@@ -8509,7 +8581,7 @@
int CvCity::getGreatPeopleUnitProgress(UnitTypes eIndex) const
{
- //Start Addition GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
//redirect to the player
@@ -8517,7 +8589,7 @@
FAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()");
return GET_PLAYER(getOwnerINLINE()).getGreatPeopleUnitProgress(eIndex);
}
- // End Addition by Impaler[WrG]
+ // < GreatPeople Point Pooling End >
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()");
@@ -8527,7 +8599,7 @@
void CvCity::setGreatPeopleUnitProgress(UnitTypes eIndex, int iNewValue)
{
- // Start Change GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
//redirect to the player
@@ -8536,29 +8608,29 @@
GET_PLAYER(getOwnerINLINE()).setGreatPeopleUnitProgress(eIndex, iNewValue);
FAssert(getGreatPeopleUnitProgress(eIndex) >= 0);
}
- else //maintain original behavior
+ else // Original Behavior
{
FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
FAssertMsg(eIndex < GC.getNumUnitInfos(), "eIndex expected to be < GC.getNumUnitInfos()");
m_paiGreatPeopleUnitProgress[eIndex] = iNewValue;
FAssert(getGreatPeopleUnitProgress(eIndex) >= 0);
}
- // End Change by Impaler[WrG]
+ // < GreatPeople Point Pooling End >
}
void CvCity::changeGreatPeopleUnitProgress(UnitTypes eIndex, int iChange)
{
- // Start Change GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
GET_PLAYER(getOwnerINLINE()).changeGreatPeopleUnitProgress(eIndex, iChange);
}
- else //Original Behavior
+ else // Original Behavior
{
setGreatPeopleUnitProgress(eIndex, (getGreatPeopleUnitProgress(eIndex) + iChange));
}
- // End Change by Impaler[WrG]
+ // < GreatPeople Point Pooling End >
}
@@ -9059,11 +9131,15 @@
{
m_paiBuildingOriginalOwner[eIndex] = eOriginalOwner;
m_paiBuildingOriginalTime[eIndex] = iOriginalTime;
+
+ m_paiBuildingOriginalTurn[eIndex] = GC.getGameINLINE().getGameTurn(); // Timer support
}
else
{
m_paiBuildingOriginalOwner[eIndex] = NO_PLAYER;
m_paiBuildingOriginalTime[eIndex] = MIN_INT;
+
+ m_paiBuildingOriginalTurn[eIndex] = 0; // Timer support
}
if (bOldHasBuilding != hasBuilding(eIndex))
@@ -9151,13 +9227,11 @@
}
}
- // Start Addition Wonder Secret Tech by moctezuma
+ // < Wonder Secret Tech by moctezuma Start >
TechTypes eFreeSpecificTech = (TechTypes) GC.getBuildingInfo(eIndex).getFreeSpecificTech();
if (eFreeSpecificTech != NO_TECH)
- {
GET_TEAM(getTeam()).setHasTech(eFreeSpecificTech, true, getOwnerINLINE(), true, true);
- }
- // End Addition by moctezuma
+ // < Wonder Secret Tech End >
if (isWorldWonderClass((BuildingClassTypes)(GC.getBuildingInfo(eIndex).getBuildingClassType())))
{
@@ -10109,10 +10183,10 @@
if (pLoopPlot != NULL)
{
- // < Start Change BordersOverOceans by Roger Bacon >
+ // < Borders Over Oceans by Roger Bacon Start >
// ORIGINAL CODE if (pLoopPlot->isPotentialCityWorkForArea(area()))
if (GC.getDefineBOOL("BORDERS_OVER_WATER") || pLoopPlot->isPotentialCityWorkForArea(area()))
- // < End Change by Roger Bacon
+ // < Borders Over Oceans End >
{
pLoopPlot->changeCulture(getOwnerINLINE(), (((getCultureLevel() - iCultureRange) * 20) + getCommerceRate(COMMERCE_CULTURE) + 1), (bUpdate || !(pLoopPlot->isOwned())));
}
@@ -10184,7 +10258,7 @@
}
}
- // Start FreeUnit Creator by Impaler[WrG]
+ // < FreeUnit Creatior by Impaler[WrG] Start >
if (hasBuilding((BuildingTypes) iI) && GC.getBuildingInfo((BuildingTypes)iI).getFreeUnitTimer() > 0)
{
if (GC.getGameINLINE().getGameTurnYear() % GC.getBuildingInfo((BuildingTypes)iI).getFreeUnitTimer() == 0)
@@ -10222,7 +10296,7 @@
gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer, "FREE_UNIT", MESSAGE_TYPE_MINOR_EVENT);
}
}
- // End Free UnitCreator by Impaler[WrG]
+ // < FreeUnit Creatior End >
}
for (iI = 0; iI < GC.getNumProjectInfos(); iI++)
@@ -10499,8 +10573,9 @@
{
return;
}
- //Start Change GreatPeoplePointPooling by Impaler[WrG]
- // Original code changeGreatPeopleProgress(getGreatPeopleRate());
+
+ // < GreatPeople Point Pooling by Impaler[WrG] Start >
+ // ORIGINAL CODE changeGreatPeopleProgress(getGreatPeopleRate());
if (GC.getGameINLINE().isOption(GAMEOPTION_GREAT_PEOPLE_POINT_POOLING))
{
GET_PLAYER(getOwnerINLINE()).changeGreatPeopleProgress(getLocalGreatPeopleRate());
@@ -10511,7 +10586,7 @@
//affected by the GreatPeoplePooling control Boolean
changeGreatPeopleProgress(getLocalGreatPeopleRate());
}
- //End Change GreatPeoplePointPooling by Impaler[WrG]
+ // < GreatPeople Point Pooling End >
for (iI = 0; iI < GC.getNumUnitInfos(); iI++)
{
@@ -10552,11 +10627,11 @@
{
setGreatPeopleUnitProgress(((UnitTypes)iI), 0);
}
- // Start Unique GreatPeople by Mexico
+ // < Unique GreatPeople by Mexico Start >
UnitClassTypes eUnitClass = (UnitClassTypes)GC.getUnitInfo(eGreatPeopleUnit).getUnitClassType();
UnitTypes iUniqueUnit = (UnitTypes)GC.getCivilizationInfo((CivilizationTypes)GET_PLAYER(getOwnerINLINE()).getCivilizationType()).getCivilizationUnits((int)eUnitClass);
eGreatPeopleUnit = (UnitTypes)((iUniqueUnit != NO_UNIT) ? iUniqueUnit : eGreatPeopleUnit);
- // End by Mexico
+ // < Unique GreatPople End >
createGreatPeople(eGreatPeopleUnit, true, false);
}
}
@@ -10799,6 +10874,10 @@
pStream->Read(NUM_COMMERCE_TYPES, m_aiNonStateReligionCommerceRateModifier);
pStream->Read(NUM_COMMERCE_TYPES, m_aiBuildingCommerceChange);
// < Changes End >
+
+ pStream->Read(&m_iPandemicTurns); // Pandemic system by Mexico - Start
+ pStream->Read(GC.getNumBuildingInfos(), m_paiBuildingOriginalTurn);
+ pStream->Read(NUM_CITY_PLOTS, m_pabWorkingPlot);
}
void CvCity::write(FDataStreamBase* pStream)
@@ -10991,6 +11070,12 @@
pStream->Write(NUM_COMMERCE_TYPES, m_aiNonStateReligionCommerceRateModifier);
pStream->Write(NUM_COMMERCE_TYPES, m_aiBuildingCommerceChange);
// < Changes End >
+
+ // Pandemic system by Mexico - Start
+ pStream->Write(m_iPandemicTurns);
+ // Pandemic system by Mexico - End
+ pStream->Write(GC.getNumBuildingInfos(), m_paiBuildingOriginalTurn);
+ pStream->Write(NUM_CITY_PLOTS, m_pabWorkingPlot);
}
@@ -11680,4 +11765,339 @@
setInfoDirty(true);
}
}
-// Changes End
\ No newline at end of file
+// Changes End
+
+bool CvCity::hasShrine(ReligionTypes eReligion)
+{
+ bool bHasShrine = false;
+
+ // note, for normal XML, this count will be one, there is only one shrine of each religion
+ int shrineBuildingCount = GC.getGameINLINE().getShrineBuildingCount(eReligion);
+ for (int iI = 0; iI < shrineBuildingCount; iI++)
+ {
+ BuildingTypes eBuilding = GC.getGameINLINE().getShrineBuilding(iI, eReligion);
+
+ if (hasBuilding(eBuilding))
+ {
+ bHasShrine = true;
+ break;
+ }
+ }
+ return bHasShrine;
+}
+
+// Timer support by Mexico
+int CvCity::getBuildingOriginalTurn(BuildingTypes eIndex) const
+{
+ FAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");
+ FAssertMsg(eIndex < GC.getNumBuildingInfos(), "eIndex expected to be < GC.getNumBuildingInfos()");
+ return m_paiBuildingOriginalTurn[eIndex];
+}
+
+void CvCity::doBuildingTimed()
+{
+ int iI;
+ BuildingTypes eLoopBuilding;
+ CvWString szBuffer;
+
+ for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
+ {
+ eLoopBuilding = ((BuildingTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(iI)));
+ if (eLoopBuilding != NO_BUILDING)
+ {
+ if (isHasRealBuilding(eLoopBuilding))
+ {
+ int iTimer = GC.getBuildingInfo(eLoopBuilding).getTimer();
+ if ( iTimer > 0)
+ {
+ if((GC.getGameINLINE().getGameTurn() - getBuildingOriginalTurn(eLoopBuilding)) >= iTimer)
+ {
+ setHasRealBuilding(eLoopBuilding, false);
+ szBuffer = gDLL->getText("TXT_KEY_CITY_BUILDING_REMOVED", GC.getBuildingInfo(eLoopBuilding).getTextKeyWide(), getNameKey());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szBuffer, GC.getBuildingInfo(eLoopBuilding).getConstructSound(), MESSAGE_TYPE_MINOR_EVENT, GC.getBuildingInfo(eLoopBuilding).getButton(), (ColorTypes)GC.getInfoTypeForString("COLOR_WHITE"), getX_INLINE(), getY_INLINE(), true, true);
+ }
+ }
+ }
+ }
+ }
+ return;
+}
+// End of timer support
+
+// Pandemic system by Mexico
+void CvCity::doPandemic()
+{
+ CvWString szMessage;
+ TCHAR tempBuff[1024];
+
+ gDLL->logMsg("Pandemic.log","--------------------------------------------");
+ sprintf(tempBuff,"Pandemia engine for city: %S ", getName().GetCString());
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ if (isImmune())
+ {
+ gDLL->logMsg("Pandemic.log","City is immune.");
+ changePandemicTurns(1);
+ return;
+ }
+
+ int finalSpreadChance = getPandemicProbability();
+
+ if (finalSpreadChance <= 0)
+ {
+ gDLL->logMsg("Pandemic.log","City is immune.");
+ if (isPandemic())
+ {
+ // Display message if pandemia is ended
+ szMessage = gDLL->getText("TXT_KEY_PANDEMIA_STRIKE_END", getName().GetCString());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szMessage, NULL, MESSAGE_TYPE_MINOR_EVENT, ARTFILEMGR.getInterfaceArtInfo("PANDEMIC_END")->getPath(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(), getY_INLINE(), true, true);
+ // set counters to immune turn
+ setPandemicTurns( -GC.getDefineINT("PANDEMIC_CITY_IMMUNE_AFTER_PANDEMIA"));
+ }
+ return;
+ }
+
+ int randRate = GC.getGameINLINE().getSorenRandNum(GC.getDefineINT("PANDEMIC_RAND_BASE"),"Pandemic spread chance");
+ sprintf(tempBuff,"random rate: %d ",randRate);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ BuildingTypes eReaper = (BuildingTypes)GC.getInfoTypeForString("BUILDING_REAPER");
+ BuildingTypes eColony = (BuildingTypes)GC.getInfoTypeForString("BUILDING_PANDEMIC_COLONY");
+
+ if (randRate <= finalSpreadChance)
+ {
+ gDLL->logMsg("Pandemic.log","Pandemia !!!");
+
+ // Pandemic code
+
+ // Display message if pandemia is started
+ if (getPandemicTurns() == 0)
+ {
+ szMessage = gDLL->getText("TXT_KEY_PANDEMIA_STRIKE", getName().GetCString());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szMessage, "AS2D_DESTROY", MESSAGE_TYPE_MAJOR_EVENT, ARTFILEMGR.getInterfaceArtInfo("PANDEMIC_START")->getPath(), (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX_INLINE(), getY_INLINE(), true, true);
+ }
+
+ // do somethig wrong : kill a citizens! - but don't go under min size
+ int kpt = GC.getDefineINT("PANDEMIC_KILL_PER_TURN");
+ int oldPop = getPopulation();
+ int minPop = GC.getDefineINT("PANDEMIC_MIN_CITY_SIZE");
+ if (oldPop > minPop)
+ {
+ setPopulation(max(minPop,oldPop-kpt));
+ szMessage = gDLL->getText("TXT_KEY_PANDEMIA_KILL", getName().GetCString(), getPopulation());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szMessage, NULL, MESSAGE_TYPE_MAJOR_EVENT, ARTFILEMGR.getInterfaceArtInfo("PANDEMIC_KILL")->getPath(), (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), getX_INLINE(), getY_INLINE(), true, true);
+ }
+
+ changePandemicTurns(1);
+ sprintf(tempBuff,"turn counter: %d ",getPandemicTurns());
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ sprintf(tempBuff,"old/new city size: %d/%d", oldPop, getPopulation());
+ gDLL->logMsg("Pandemic.log",tempBuff);
+ // health damage for stationed units
+ // ......
+ //szMessage = gDLL->getText("TXT_KEY_PANDEMIA_CITY_UNIT_DAMAGED", getName().GetCString());
+ //gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szMessage, "", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"));
+ // health damage for units around city
+ // .......
+ //szMessage = gDLL->getText("TXT_KEY_PANDEMIA_AROUND_UNIT_DAMAGED", getName().GetCString());
+ //gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szMessage, "", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"));
+ // "build" building as visual representation
+ if (eReaper != -1)
+ {
+ setHasRealBuilding(eReaper,true);
+ }
+ }
+ else
+ {
+ if (isPandemic())
+ {
+ szMessage = gDLL->getText("TXT_KEY_PANDEMIA_STRIKE_END", getName().GetCString());
+ gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getDefineINT("EVENT_MESSAGE_TIME"), szMessage, "", MESSAGE_TYPE_MINOR_EVENT, ARTFILEMGR.getInterfaceArtInfo("PANDEMIC_END")->getPath(), (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(), getY_INLINE(), true, true);
+ // set counters to immune turn
+ setPandemicTurns( -GC.getDefineINT("PANDEMIC_CITY_IMMUNE_AFTER_PANDEMIA"));
+ }
+ // remove visual building representation
+ if (eReaper != -1)
+ {
+ setHasRealBuilding(eReaper,false);
+ }
+ if (eColony != -1)
+ {
+ setHasRealBuilding(eColony,false);
+ }
+ }
+
+ return;
+}
+
+int CvCity::getPandemicProbabilityPercent()
+{
+ return ((getPandemicProbability() * 100) / GC.getDefineINT("PANDEMIC_RAND_BASE"));
+}
+
+int CvCity::getPandemicProbability()
+{
+ BuildingTypes eLoopBuilding;
+ CvCity* pLoopCity;
+ CvPlot* pLoopPlot;
+ FeatureTypes eFeature;
+ CvWString szMessage;
+ int iI;
+
+ TCHAR tempBuff[1024];
+
+ gDLL->logMsg("Pandemic.log",".....................................");
+ sprintf(tempBuff,"Pandemic probability for city: %S ", getName().GetCString());
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ // check for immunity
+ if(isImmune())
+ {
+ gDLL->logMsg("Pandemic.log","City is immune.");
+ gDLL->logMsg("Pandemic.log",".....................................");
+ return 0;
+ }
+
+ // check for minimum turns
+ if(isPandemic() && (GC.getDefineINT("PANDEMIC_MIN_TURNS")!= -1) && (getPandemicTurns() < GC.getDefineINT("PANDEMIC_MIN_TURNS")))
+ {
+ gDLL->logMsg("Pandemic.log","Pandemia continue...(no min turns)");
+ gDLL->logMsg("Pandemic.log",".....................................");
+ return (GC.getDefineINT("PANDEMIC_RAND_BASE"));
+ }
+
+ // check for maximum turns
+ if(isPandemic() && (GC.getDefineINT("PANDEMIC_MIN_TURNS")!= -1) && (getPandemicTurns() >= GC.getDefineINT("PANDEMIC_MAX_TURNS")))
+ {
+ gDLL->logMsg("Pandemic.log","Pandemia stop...(max turns)");
+ gDLL->logMsg("Pandemic.log",".....................................");
+ return 0;
+ }
+
+ // base spread rate
+ int finalSpreadChance = GC.getDefineINT("PANDEMIC_BASE_RATE");
+ sprintf(tempBuff,"Base chance: %d ",finalSpreadChance);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ // each unhealth point increase chance
+ // we must negate this, because healthRate return negative points
+ int unhealth = (-(healthRate(false,0))) * GC.getDefineINT("PANDEMIC_UNHEALTH_RATE");
+ finalSpreadChance += unhealth;
+ sprintf(tempBuff,"unhealth modification: %d ",unhealth);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ // buildings/wonders modifier
+ int building = 0;
+ for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
+ {
+ eLoopBuilding = ((BuildingTypes)(GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(iI)));
+ if (eLoopBuilding != NO_BUILDING)
+ {
+ if (isHasRealBuilding(eLoopBuilding))
+ {
+ building += GC.getBuildingInfo(eLoopBuilding).getPandemicModifier();
+ }
+ }
+ }
+ finalSpreadChance += building;
+ sprintf(tempBuff,"buildings modification: %d ",building);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ // player global modifier (ie from trait/projects/tech/civic/wonder)
+ int player = GET_PLAYER(getOwnerINLINE()).getGlobalPandemicModifier();
+ finalSpreadChance += player;
+ sprintf(tempBuff,"player(global) modification: %d ",player);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ // other modifications: previous turns, trade rute, num of pandemic turns etc..
+ int trade = 0;
+ for (iI = 0; iI < GC.getDefineINT("MAX_TRADE_ROUTES"); iI++)
+ {
+ pLoopCity = getTradeCity(iI);
+ if (pLoopCity != NULL)
+ {
+ if(pLoopCity->isPandemic())
+ {
+ trade += GC.getDefineINT("PANDEMIC_TRADE_RATE");
+ }
+ }
+ }
+ finalSpreadChance += trade;
+ sprintf(tempBuff,"trade route modification: %d ",trade);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ int terrain = 0;
+
+ for (iI = 0; iI < NUM_CITY_PLOTS; iI++)
+ {
+ pLoopPlot = getCityIndexPlot(iI);
+
+ if (pLoopPlot != NULL)
+ {
+ eFeature = pLoopPlot->getFeatureType();
+
+ if (eFeature != NO_FEATURE)
+ {
+ terrain += GC.getFeatureInfo(eFeature).getPandemicModifier();
+ }
+ }
+ }
+ finalSpreadChance += terrain;
+ sprintf(tempBuff,"terrain features modification: %d ",terrain);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ int other = 0;
+
+ if (isPandemic())
+ {
+ if ( getPandemicTurns() < GC.getDefineINT("PANDEMIC_TURN_IMMUNE"))
+ {
+ other += GC.getDefineINT("PANDEMIC_TURN_RATE_SPREAD");
+ }
+ else
+ {
+ other -= GC.getDefineINT("PANDEMIC_TURN_RATE_IMMUNIZE");
+ }
+ }
+ finalSpreadChance += other;
+ sprintf(tempBuff,"other (turns,...) modification: %d ",other);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ sprintf(tempBuff,"final chance before normalization: %d",finalSpreadChance);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+
+ finalSpreadChance = min(finalSpreadChance,GC.getDefineINT("PANDEMIC_MAX_CHANCE"));
+ finalSpreadChance = max(GC.getDefineINT("PANDEMIC_MIN_CHANCE"),finalSpreadChance);
+ sprintf(tempBuff,"final chance: %d",finalSpreadChance);
+ gDLL->logMsg("Pandemic.log",tempBuff);
+ gDLL->logMsg("Pandemic.log",".....................................");
+
+ return finalSpreadChance;
+}
+
+bool CvCity::isPandemic() const
+{
+ return (m_iPandemicTurns > 0);
+}
+
+bool CvCity::isImmune() const
+{
+ return (m_iPandemicTurns < 0);
+}
+
+void CvCity::changePandemicTurns(int iChange)
+{
+ setPandemicTurns(getPandemicTurns() + iChange);
+}
+
+void CvCity::setPandemicTurns(int iNewValue)
+{
+ m_iPandemicTurns = iNewValue;
+}
+
+int CvCity::getPandemicTurns() const
+{
+ return m_iPandemicTurns;
+}
+// Pandemic system end
\ No newline at end of file
Modified: CvGameCoreDLL/CvCity.h
===================================================================
--- CvGameCoreDLL/CvCity.h 2007-03-12 21:52:58 UTC (rev 40)
+++ CvGameCoreDLL/CvCity.h 2007-03-13 05:07:20 UTC (rev 41)
@@ -189,7 +189,7 @@
int productionLeft() const; // Exposed to Python
int hurryCost(bool bExtra) const; // Exposed to Python
- int getHurryCostModifier() const;
+ int getHurryCostModifier(bool bIgnoreNew = false) const;
DllExport int hurryGold(HurryTypes eHurry) const; // Exposed to Python
DllExport int hurryPopulation(HurryTypes eHurry) const; // Exposed to Python
int hurryProduction(HurryTypes eHurry) const; // Exposed to Python
@@ -776,24 +776,24 @@
//------------------CCCP NEW-----------------------
- int getLocalGreatPeopleRate() const; // GreatPeoplePointPooling by Impaler[WrG]
+ int getLocalGreatPeopleRate() const; // < GreatPeoplePointPooling by Impaler[WrG] >
- int getLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eIndex) const; // LocalSpecialistYieldChange by Impaler[WrG]
- void changeLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eYield, int iChange); // LocalSpecialistYieldChange by Impaler[WrG]
- int getLocalSpecialistCommerceChange( SpecialistTypes eSpecialist, CommerceTypes eIndex) const; // LocalSpecialistCommerceChange by Impaler[WrG]
- void changeLocalSpecialistCommerceChange(SpecialistTypes eSpecialist, CommerceTypes eYield, int iChange); // LocalSpecialistCommerceChange by Impaler[WrG]
+ int getLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eIndex) const; // < Local Specialist Yield Change by Impaler[WrG] >
+ void changeLocalSpecialistYieldChange(SpecialistTypes eSpecialist, YieldTypes eYield, int iChange); // < Local Specialist Yield Change by Impaler[WrG] >
+ int getLocalSpecialistCommerceChange( SpecialistTypes eSpecialist, CommerceTypes eIndex) const; // < Local Specialist CommerceChange by Impaler[WrG] >
+ void changeLocalSpecialistCommerceChange(SpecialistTypes eSpecialist, CommerceTypes eYield, int iChange); // < Local Specialist CommerceChange by Impaler[WrG] >
- bool isFreeConnections() const; // FreeAreaConnections by Impaler[WrG]
- void setFreeConnections(bool newValue); // Addition FreeAreaConnections by Impaler[WrG]
+ bool isFreeConnections() const; // < Free Area Connections by Impaler[WrG] >
+ void setFreeConnections(bool newValue); // < Free Area Connections by Impaler[WrG] >
- // < Building Resource Converter Start >
+ // < Building Resource Converter By Lopez Start >
void processBuildingBonuses();
DllExport int getBuildingOutputBonus(BonusTypes eIndex); // Exposed to Python
void resetBuildingOutputBonuses();
// < Building Resource Converter End >
- int getSpyDefenceModifier() const; // Additional Spy Missions by Impaler[WrG]
- void changeSpyDefenceModifier(int iChange); // Additional Spy Missions by Impaler[WrG]
+ int getSpyDefenceModifier() const; // < Spy Missions by Impaler[WrG] >
+ void changeSpyDefenceModifier(int iChange); // < Spy Missions by Impaler[WrG] >
// Changes Start
int getReligionGoodHealth() const; // Exposed to Python
@@ -802,7 +802,7 @@
void updateReligionHealth();
// Changes End
- // < Changes Start >
+ // < Civics Balance by Aussie Lurker Start >
int getBuildingYieldChange(YieldTypes eIndex) const;
void changeBuildingYieldChange(YieldTypes eIndex, int iChange);
void updateBuildingYieldChange();
@@ -822,8 +822,27 @@
int getBuildingCommerceChange(CommerceTypes eIndex) const;
void changeBuildingCommerceChange(CommerceTypes eIndex, int iChange);
void updateBuildingCommerceChange();
- // < Changes End >
+ // < Civics Balance End >
+ int getArea() const;
+ int getBuildingOriginalTurn(BuildingTypes eIndex) const;
+ void doBuildingTimed(); // Timer support by Mexico
+
+ DllExport bool isConnectedToOcean(); // < Is Connected To Ocean by 12Monkeys > Exposed to Python
+
+ // < Pandemics by Mexico Start >
+ DllExport bool isPandemic() const;
+ DllExport bool isImmune() const;
+ DllExport int getPandemicTurns() const;
+ DllExport void setPandemicTurns(int iNewValue);
+ DllExport void changePandemicTurns(int iChange);
+ DllExport int getPandemicProbabilityPercent();
+ DllExport int getPandemicProbability();
+ void doPandemic();
+ // < Pandemics End >
+
+ bool hasShrine(ReligionTypes eReligion); // < Has Shrine by Mexico >
+
protected:
int m_iID;
@@ -1004,13 +1023,15 @@
virtual bool AI_addBestCitizen(bool bWorkers, bool bSpecialists) = 0;
virtual bool AI_removeWorstCitizen(SpecialistTypes eIgnoreSpecialist = NO_SPECIALIST) = 0;
- int** m_ppaaiLocalSpecialistExtraYield; // Additon LocalSpecialistYieldChange by Impaler[WrG]
- int** m_ppaaiLocalSpecialistExtraCommerce; // Additon LocalSpecialistCommerceChange by Impaler[WrG]
- bool m_bFreeConnections; // Addition FreeAreaConnections by Impaler[WrG]
- int* m_paiBuildingOutputBonuses; // < Building Resource Converter >
+ //---------------------------------CCCP NEW-----------------------------------
- int m_SpyDefenseModifier; // Additional Spy Missions by Impaler[WrG]
+ int** m_ppaaiLocalSpecialistExtraYield; // < Local Specialist YieldChange by Impaler[WrG] >
+ int** m_ppaaiLocalSpecialistExtraCommerce; // < LocalSpecialistCommerceChange by Impaler[WrG] >
+ bool m_bFreeConnections; // < FreeAreaConnections by Impaler[WrG] >
+ int* m_paiBuildingOutputBonuses; // < Building Resource Converter by Lopez >
+ int m_SpyDefenseModifier; // < Spy Missions by Impaler[WrG] >
+
// Changes Start
int m_iReligionGoodHealth;
int m_iReligionBadHealth;
@@ -1024,6 +1045,19 @@
int* m_aiStateReligionCommerceRateModifier;
int* m_aiNonStateReligionCommerceRateModifier;
// < Changes End >
+
+ int* m_paiBuildingOriginalTurn; // Timer support by Mexico
+
+ int m_iPopulationRank;
+ bool m_bPopulationRankValid;
+ int* m_aiBaseYieldRank;
+ bool* m_abBaseYieldRankValid;
+ int* m_aiYieldRank;
+ bool* m_abYieldRankValid;
+ int* m_aiCommerceRank;
+ bool* m_abCommerceRankValid;
+
+ int m_iPandemicTurns; // < Pandemics by Mexico >
};
#endif
Modified: CvGameCoreDLL/CvGame.cpp
===================================================================
--- CvGameCoreDLL/CvGame.cpp 2007-03-12 21:52:58 UTC (rev 40)
+++ CvGameCoreDLL/CvGame.cpp 2007-03-13 05:07:20 UTC (rev 41)
@@ -22,6 +22,7 @@
#include "FProfiler.h"
#include "CvReplayInfo.h"
#include "CyPlot.h"
+#include "CvGameTextMgr.h"
// interface uses
#include "CvDLLInterfaceIFaceBase.h"
@@ -29,6 +30,12 @@
#include "CvDLLEventReporterIFaceBase.h"
#include "CvDLLPythonIFaceBase.h"
+// for testing only
+#ifndef FINAL_RELEASE
+//#define DEBUG_OUT_OF_SYNCS
+#endif
+
+
// Public Functions...
CvGame::CvGame()
@@ -225,7 +232,10 @@
{
if (isVictoryValid((VictoryTypes)iI))
{
- if ((GC.getVictoryInfo((VictoryTypes)iI).isEndScore()) || (GC.getVictoryInfo((VictoryTypes)iI).isTotalVictory())) // Mastery Victory by Sevo
+ // < Mastery Victory by Sevo Start >
+ // ORIGINAL CODE if (GC.getVictoryInfo((VictoryTypes)iI).isEndScore())
+ if ((GC.getVictoryInfo((VictoryTypes)iI).isEndScore()) || (GC.getVictoryInfo((VictoryTypes)iI).isTotalVictory()))
+ // < Mastery Victory End >
{
bValid = true;
break;
@@ -244,7 +254,7 @@
setEstimateEndTurn(getGameTurn() + getMaxTurns());
}
- // Start Mastery Victory by Sevo
+ // < Mastery Victory by Sevo Start >
bValid = false;
for (iI = 0; iI < GC.getNumVictoryInfos(); iI++)
{
@@ -262,9 +272,8 @@
setVictoryValid((VictoryTypes)iI, true);
}
}
- // End Mastery Victory by Sevo
+ // < Mastery Victory End >
-
setStartYear(GC.getDefineINT("START_YEAR"));
for (iI = 0; iI < GC.getNumSpecialUnitInfos(); iI++)
@@ -443,6 +452,12 @@
m_bHotPbemBetweenTurns = false;
m_bPlayerOptionsSent = false;
+ // < Inquisition Mod by Lopez Start >
+ m_bRequireStateReligionForReligionRemoval = true;
+ m_bRequireCityOwnerStateReligionMatchForReligionRemoval = true;
+ m_bRequireOpenBordersForReligionRemoval = true;
+ // < Inquisition Mod End >
+
m_eHandicap = eHandicap;
m_ePausePlayer = NO_PLAYER;
m_eBestLandUnit = NO_UNIT;
@@ -991,8 +1006,19 @@
{
if (!pStartingPlot->isFreshWater())
{
+ // < River Maker by ??? Start >
+ // if we will be able to add a lake, then use old river code
+ if (normalizeFindLakePlot((PlayerTypes)iI) != NULL)
+ {
CvMapGenerator::GetInstance().doRiver(pStartingPlot);
}
+ // otherwise, use new river code which is much more likely to succeed
+ else
+ {
+ CvMapGenerator::GetInstance().addRiver(pStartingPlot);
+ }
+ // < River Maker End >
+ }
}
}
}
@@ -1049,15 +1075,30 @@
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
{
- pStartingPlot = GET_PLAYER((PlayerTypes)iI).getStartingPlot();
+ CvPlot* pLakePlot = normalizeFindLakePlot((PlayerTypes)iI);
+ if (pLakePlot != NULL)
+ {
+ pLakePlot->setPlotType(PLOT_OCEAN);
+ }
+ }
+ }
+}
+CvPlot* CvGame::normalizeFindLakePlot(PlayerTypes ePlayer)
+{
+ if (!GET_PLAYER(ePlayer).isAlive())
+ {
+ return NULL;
+ }
+
+ CvPlot* pStartingPlot = GET_PLAYER(ePlayer).getStartingPlot();
if (pStartingPlot != NULL)
{
if (!(pStartingPlot->isFreshWater()))
{
- for (iJ = 0; iJ < NUM_CITY_PLOTS; iJ++)
+ for (int iJ = 0; iJ < NUM_CITY_PLOTS; iJ++)
{
- pLoopPlot = plotCity(pStartingPlot->getX_INLINE(), pStartingPlot->getY_INLINE(), iJ);
+ CvPlot* pLoopPlot = plotCity(pStartingPlot->getX_INLINE(), pStartingPlot->getY_INLINE(), iJ);
if (pLoopPlot != NULL)
{
@@ -1069,9 +1110,9 @@
{
if (pLoopPlot->getBonusType() == NO_BONUS)
{
- bStartingPlot = false;
+ bool bStartingPlot = false;
- for (iK = 0; iK < MAX_CIV_PLAYERS; iK++)
+ for (int iK = 0; iK < MAX_CIV_PLAYERS; iK++)
{
if (GET_PLAYER((PlayerTypes)iK).isAlive())
{
@@ -1085,10 +1126,7 @@
if (!bStartingPlot)
{
- pLoopPlot->setPlotType(PLOT_OCEAN);
- break;
- }
- }
+ return pLoopPlot;
}
}
}
@@ -1098,6 +1136,8 @@
}
}
}
+
+ return NULL;
}
@@ -1132,6 +1172,42 @@
}
}
}
+
+ int iX, iY;
+ int iCityRange = CITY_PLOTS_RADIUS;
+ int iExtraRange = 2;
+ int iMaxRange = iCityRange + iExtraRange;
+
+ for (iX = -iMaxRange; iX <= iMaxRange; iX++)
+ {
+ for (iY = -iMaxRange; iY <= iMaxRange; iY++)
+ {
+ pLoopPlot = plotXY(pStartingPlot->getX_INLINE(), pStartingPlot->getY_INLINE(), iX, iY);
+ if (pLoopPlot != NULL)
+ {
+ int iDistance = plotDistance(pStartingPlot->getX_INLINE(), pStartingPlot->getY_INLINE(), pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE());
+ if (iDistance <= iMaxRange)
+ {
+ if (pLoopPlot->getFeatureType() != NO_FEATURE)
+ {
+ if ((GC.getFeatureInfo(pLoopPlot->getFeatureType()).getYieldChange(YIELD_FOOD) <= 0) && (GC.getFeatureInfo(pLoopPlot->getFeatureType()).getYieldChange(YIELD_PRODUCTION) <= 0))
+ {
+ if (pLoopPlot->isWater())
+ {
+ if (pLoopPlot->isAdjacentToLand() || (!(iDistance == iMaxRange) && (getSorenRandNum(2, "Remove Bad Feature") == 0)))
+ pLoopPlot->setFeatureType(NO_FEATURE);
+ }
+ else
+ {
+ if (!(iDistance == iMaxRange) && (getSorenRandNum((2 + (pLoopPlot->getBonusType() == NO_BONUS) ? 0 : 2), "Remove Bad Feature") == 0))
+ pLoopPlot->setFeatureType(NO_FEATURE);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}
@@ -1141,8 +1217,19 @@
{
CvPlot* pStartingPlot;
CvPlot* pLoopPlot;
- int iI, iJ, iK;
+ int iI, iK;
+ int iX, iY;
+ int iTargetFood;
+ int iTargetTotal;
+ int iPlotFood;
+ int iPlotProduction;
+
+
+ int iCityRange = CITY_PLOTS_RADIUS;
+ int iExtraRange = 1;
+ int iMaxRange = iCityRange + iExtraRange;
+
for (iI = 0; iI < MAX_CIV_PLAYERS; iI++)
{
if (GET_PLAYER((PlayerTypes)iI).isAlive())
@@ -1151,24 +1238,48 @@
if (pStartingPlot != NULL)
{
- for (iJ = 0; iJ < NUM_CITY_PLOTS; iJ++)
+ for (iX = -iMaxRange; iX <= iMaxRange; iX++)
{
- pLoopPlot = plotCity(pStartingPlot->getX_INLINE(), pStartingPlot->getY_INLINE(), iJ);
-
+ for (iY = -iMaxRange; iY <= iMaxRange; iY++)
+ {
+ pLoopPlot = plotXY(pStartingPlot->getX_INLINE(), pStartingPlot->getY_INLINE(), iX, iY);
if (pLoopPlot != NULL)
{
- if (!(pLoopPlot->isWater()))
+ int iDistance = plotDistance(pStartingPlot->getX_INLINE(), pStartingPlot->getY_INLINE(), pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE());
+ if (iDistance <= iMaxRange)
+ {
+ if (!(pLoopPlot->isWater()) && ((iDistance <= iCityRange) || (pLoopPlot->isCoastalLand()) || (0 == getSorenRandNum(1 + iDistance - iCityRange, "Map Upgrade Terrain Food"))))
+ {
+ iPlotFood = GC.getTerrainInfo(pLoopPlot->getTerrainType()).getYield(YIELD_FOOD);
+ iPlotProduction = GC.getTerrainInfo(pLoopPlot->getTerrainType()).getYield(YIELD_PRODUCTION);
+ if ((iPlotFood + iPlotProduction) <= 1)
{
- if ((GC.getTerrainInfo(pLoopPlot->getTerrainType()).getYield(YIELD_FOOD) + GC.getTerrainInfo(pLoopPlot->getTerrainType()).getYield(YIELD_PRODUCTION)) <= 1)
+ iTargetFood = 1;
+ iTargetTotal = 1;
+ if (pLoopPlot->getBonusType(GET_PLAYER((PlayerTypes)iI).getTeam()) != NO_BONUS)
+ {
+ iTargetFood = 1;
+ iTargetTotal = 2;
+ }
+ else if ((iPlotFood == 1) || (iDistance <= iCityRange))
+ {
+ iTargetFood = 1 + getSorenRandNum(2, "Map Upgrade Terrain Food");
+ iTargetTotal = 2;
+ }
+ else
{
+ iTargetFood = pLoopPlot->isCoastalLand() ? 2 : 1;
+ iTargetTotal = 2;
+ }
+
for (iK = 0; iK < GC.getNumTerrainInfos(); iK++)
{
if (!(GC.getTerrainInfo((TerrainTypes)iK).isWater()))
{
- if ((GC.getTerrainInfo((TerrainTypes)iK).getYield(YIELD_FOOD) + GC.getTerrainInfo((TerrainTypes)iK).getYield(YIELD_PRODUCTION)) > 1)
+ if ((GC.getTerrainInfo((TerrainTypes)iK).getYield(YIELD_FOOD) >= iTargetFood) &&
+ (GC.getTerrainInfo((TerrainTypes)iK).getYield(YIELD_FOOD) + GC.getTerrainInfo((TerrainTypes)iK).getYield(YIELD_PRODUCTION)) == iTargetTotal)
{
if ((pLoopPlot->getFeatureType() == NO_FEATURE) || GC.getFeatureInfo(pLoopPlot->getFeatureType()).isTerrain(iK))
- {
pLoopPlot->setTerrainType((TerrainTypes)iK);
}
}
@@ -1181,6 +1292,7 @@
}
}
}
+ }
}
@@ -1191,6 +1303,7 @@
BonusTypes eBonus;
bool bIgnoreLatitude;
int iFoodBonus;
+ int iGoodNatureTileCount;
int iI, iJ, iK;
bIgnoreLatitude = false;
@@ -1205,6 +1318,7 @@
if (pStartingPlot != NULL)
{
iFoodBonus = 0;
+ iGoodNatureTileCount = 0;
for (iJ = 0; iJ < NUM_CITY_PLOTS; iJ++)
{
@@ -1216,27 +1330,41 @@
if (eBonus != NO_BONUS)
{
+ if (pLoopPlot->calculateBestNatureYield(YIELD_FOOD, GET_PLAYER((PlayerTypes)iI).getTeam()) >= 2)
+ {
+ iGoodNatureTileCount++;
+ }
if (GC.getBonusInfo(eBonus).getYieldChange(YIELD_FOOD) > 0)
{
if ((GC.getBonusInfo(eBonus).getTechCityTrade() == NO_TECH) || (GC.getTechInfo((TechTypes)(GC.getBonusInfo(eBonus).getTechCityTrade())).getEra() <= getStartEra()))
{
if (pLoopPlot->isWater())
{
- iFoodBonus++;
+ iFoodBonus += 2;
}
else
{
- iFoodBonus += 2;
+ iFoodBonus += 3;
}
+ }
}
}
+ else
+ {
+ if (pLoopPlot->calculateBestNatureYield(YIELD_FOOD, GET_PLAYER((PlayerTypes)iI)....
[truncated message content] |