|
From: <imp...@us...> - 2007-03-10 04:15:29
|
Revision: 33
http://civ4ccp.svn.sourceforge.net/civ4ccp/?rev=33&view=rev
Author: impalerwrg
Date: 2007-03-09 20:15:26 -0800 (Fri, 09 Mar 2007)
Log Message:
-----------
Unique GreatPeople by Mexico
Modified Paths:
--------------
CvGameCoreDLL/CvCity.cpp
CvGameCoreDLL/CvPlayer.cpp
Modified: CvGameCoreDLL/CvCity.cpp
===================================================================
--- CvGameCoreDLL/CvCity.cpp 2007-03-05 06:00:08 UTC (rev 32)
+++ CvGameCoreDLL/CvCity.cpp 2007-03-10 04:15:26 UTC (rev 33)
@@ -10565,7 +10565,11 @@
{
setGreatPeopleUnitProgress(((UnitTypes)iI), 0);
}
-
+ // Start Unique GreatPeople by Mexico
+ 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
createGreatPeople(eGreatPeopleUnit, true, false);
}
}
Modified: CvGameCoreDLL/CvPlayer.cpp
===================================================================
--- CvGameCoreDLL/CvPlayer.cpp 2007-03-05 06:00:08 UTC (rev 32)
+++ CvGameCoreDLL/CvPlayer.cpp 2007-03-10 04:15:26 UTC (rev 33)
@@ -130,13 +130,11 @@
//--------------------------CCCP NEW-------------------------------
- // <Changes Start >
SAFE_DELETE_ARRAY(m_aiStateReligionYieldRateModifier);
SAFE_DELETE_ARRAY(m_aiSpecialistExtraYield);
SAFE_DELETE_ARRAY(m_aiNonStateReligionYieldRateModifier);
SAFE_DELETE_ARRAY(m_aiStateReligionCommerceRateModifier);
SAFE_DELETE_ARRAY(m_aiNonStateReligionCommerceRateModifier);
- // Changes End
}
@@ -8609,6 +8607,7 @@
if (m_iCombatExperience >= iExperienceThreshold && iExperienceThreshold > 0)
{
ORIGINAL CODE END */
+
if (iExperience == getCombatExperience())
{
return;
@@ -8634,41 +8633,47 @@
}
// < Great Generals From Barbarian Combat End >
- // create great person
- CvCity* pBestCity = NULL;
- int iBestValue = MAX_INT;
- int iLoop;
- for (CvCity* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
- {
- int iValue = 4 * GC.getGameINLINE().getSorenRandNum(getNumCities(), "Warlord City Selection");
+ // create great person
+ CvCity* pBestCity = NULL;
+ int iBestValue = MAX_INT;
+ int iLoop;
+ for (CvCity* pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))
+ {
+ int iValue = 4 * GC.getGameINLINE().getSorenRandNum(getNumCities(), "Warlord City Selection");
- for (int i = 0; i < NUM_YIELD_TYPES; i++)
- {
- iValue += pLoopCity->findYieldRateRank((YieldTypes)i);
- }
- iValue += pLoopCity->findPopulationRank();
+ for (int i = 0; i < NUM_YIELD_TYPES; i++)
+ {
+ iValue += pLoopCity->findYieldRateRank((YieldTypes)i);
+ }
+ iValue += pLoopCity->findPopulationRank();
- if (iValue < iBestValue)
- {
- pBestCity = pLoopCity;
- iBestValue = iValue;
- }
- }
+ if (iValue < iBestValue)
+ {
+ pBestCity = pLoopCity;
+ iBestValue = iValue;
+ }
+ }
- if (pBestCity)
- {
- int iRandOffset = GC.getGameINLINE().getSorenRandNum(GC.getNumUnitInfos(), "Warlord Unit Generation");
- for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
- {
- UnitTypes eLoopUnit = (UnitTypes)((iI + iRandOffset) % GC.getNumUnitInfos());
- if (GC.getUnitInfo(eLoopUnit).getLeaderExperience() > 0 || GC.getUnitInfo(eLoopUnit).getLeaderPromotion() != NO_PROMOTION)
- {
- pBestCity->createGreatPeople(eLoopUnit, false, true);
- setCombatExperience(getCombatExperience() - iExperienceThreshold);
- break;
- }
- }
- }
+ if (pBestCity)
+ {
+ int iRandOffset = GC.getGameINLINE().getSorenRandNum(GC.getNumUnitInfos(), "Warlord Unit Generation");
+ for (int iI = 0; iI < GC.getNumUnitInfos(); iI++)
+ {
+ UnitTypes eLoopUnit = (UnitTypes)((iI + iRandOffset) % GC.getNumUnitInfos());
+ if (GC.getUnitInfo(eLoopUnit).getLeaderExperience() > 0 || GC.getUnitInfo(eLoopUnit).getLeaderPromotion() != NO_PROMOTION)
+ {
+ // Start Unique GreatPeople by Mexico
+ UnitClassTypes eUnitClass = (UnitClassTypes)GC.getUnitInfo(eLoopUnit).getUnitClassType();
+ UnitTypes iUniqueUnit = (UnitTypes)GC.getCivilizationInfo((CivilizationTypes)getCivilizationType()).getCivilizationUnits((int)eUnitClass);
+ eLoopUnit = (UnitTypes)((iUniqueUnit != NO_UNIT) ? iUniqueUnit : eLoopUnit);
+ // End by Mexico
+
+ pBestCity->createGreatPeople(eLoopUnit, false, true);
+ setCombatExperience(getCombatExperience() - iExperienceThreshold);
+ break;
+ }
+ }
+ }
// < Great Generals From Barbarian Combat Start >
//}
//}
@@ -8788,7 +8793,7 @@
{
if (!isEverAlive())
{
- m_bEverAlive = true;
+ m_bEverAlive = true;
GET_TEAM(getTeam()).changeEverAliveCount(1);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|