Pavel Chichikov
King
- Joined
- May 26, 2012
- Messages
- 674
City spawn dates, added Independent Kabul as a buffer because Persian AI always gets raped over there.
# Spawning cities (Leoreth)
# Year, coordinates, owner, name, population, unit type, unit number, religions, forced spawn
tMinorCities = (
(-3000, (73, 38), iIndependent, 'Yerushalayim', 2, con.iArcher, 2), # Jerusalem
(-3000, (79, 40), iIndependent2, 'Shushan', 2, con.iArcher, 1), # Susa
(-2000, (85, 47), iIndependent, 'Afrosiyab', 1, con.iArcher, 1), # Samarkand
(-2000, (92, 39), iIndependent, 'Varanasi', 1, con.iWarrior, 1), # Varanasi
(-2000, (90, 40), iIndependent, 'Indraprastha', 1, con.iWarrior, 1), # Delhi
(-1000, (102, 47), iIndependent, 'Zhongdu', 2, con.iSpearman, 1), # Beijing
(-1000, (72, 44), iIndependent, 'Ankuwash', 2, con.iArcher, 2), # Ankara
(-760, (59, 47), iCeltia, 'Melpum', 2, con.iArcher, 2), # Milan
(-350, (56, 47), iCeltia, 'Lugodunon', 2, -1, -1), # Lyon
(-325, (92, 33), iIndependent, 'Kanchipuram', 2, con.iArcher, 1), # Madras
(-300, (105, 49), iBarbarian, 'Simiyan hoton', 2, con.iChariot, 2), # Shenyang
(-300, (53, 48), iCeltia, 'Burdigala', 2, -1, -1), # Bordeaux
(-300, (91, 31), iIndependent, 'Tanjapuri', 1, con.iWarElephant, 1), # Thanjavur
(-2000, (77, 44), iIndependent2, 'Artashat', 2, con.iArcher, 1), # Artaxata
(-100, (95, 47), iBarbarian, 'Dunhuang', 2, con.iArcher, 1), # Dunhuang
(-100, (19, 35), iNative, 'Danni Báa', 2, con.iMayaHolkan, 2), # Monte Albán
(-75, (89, 46), iBarbarian, 'Kashgar', 2, con.iArcher, 1), # Kashgar
(-50, (55, 50), iCeltia, 'Lutetia', 2, -1, -1), # Paris
(100, (76, 30), iIndependent, "Sana'a", 2, -1, -1), # Sana'a
(107, (98, 36), iIndependent2, 'Pagan', 2, -1, -1), # Pagan
(633, (96, 43), iBarbarian, 'Rasa', 2, con.iTibetanKhampa, 1), # Lhasa
(680, (51, 37), iIndependent, 'Marrakus', 1, con.iCrossbowman, 1), # Marrakesh
(700, (30, 20), iNative, 'Tiwanaku', 1, -1, -1), # Tihuanaco
(800, con.tVienna, iIndependent, 'Vindobona', 1, con.iLongbowman, 1), # Wien
(830, (59, 54), iIndependent, 'Hamburg', 2, con.iCrossbowman, 1), # Hamburg
(830, (60, 54), iIndependent, 'Lübeck', 2, con.iCrossbowman, 1), # Lübeck
(866, (101, 37), iBarbarian, 'Hanoi', 2, -1, -1), # Hanoi
(880, (65, 48), iIndependent2, 'Buda', 3, con.iHorseArcher, 5), # Budapest
(900, (24, 26), iNative, 'Tucume', 1, con.iArcher, 2), # Tucume
(900, (25, 23), iNative, 'Chan Chan', 2, con.iArcher, 2), # Chan Chan
(900, (69, 52), iIndependent, 'Kyiv', 2, con.iLongbowman, 2), # Kiev
(990, (49, 56), iCeltia, 'Áth Cliath', 1, -1, -1), # Dublin
(1000, (61, 63), iIndependent2, 'Nidaros', 1, con.iVikingBerserker, 1), # Trondheim
(1000, (71, 17), iNative, 'Quelimane', 1, con.iZuluImpi, 1), # Quelimane
(1100, (71, 20), iNative, 'Mombasa', 1, con.iZuluImpi, 1), # Mombasa
(1200, (77, 55), iBarbarian, 'Qazan', 2, con.iHorseArcher, 1), # Kazan
(1483, (62, 20), iNative, 'Mbanza Kongo', 1, con.iCongoPombos, 1), # Mbanza Kongoх.
// Returns true if a mission was pushed...
// iMaxCount = 1 would mean construct only if there are no existing buildings
// constructed by this GP type.
bool CvUnitAI::AI_construct(int iMaxCount, int iMaxSingleBuildingCount, int iThreshold)
{
PROFILE_FUNC();
CvCity* pLoopCity;
CvPlot* pBestPlot;
CvPlot* pBestConstructPlot;
BuildingTypes eBestBuilding;
int iValue;
int iBestValue;
int iLoop;
int iI;
int iCount;
iBestValue = 0;
pBestPlot = NULL;
pBestConstructPlot = NULL;
eBestBuilding = NO_BUILDING;
iCount = 0;
for (pLoopCity = GET_PLAYER(getOwnerINLINE()).firstCity(&iLoop); pLoopCity != NULL; pLoopCity = GET_PLAYER(getOwnerINLINE()).nextCity(&iLoop))
{
if (AI_plotValid(pLoopCity->plot()) && pLoopCity->area() == area())
{
if (!(pLoopCity->plot()->isVisibleEnemyUnit(this)))
{
if (GET_PLAYER(getOwnerINLINE()).AI_plotTargetMissionAIs(pLoopCity->plot(), MISSIONAI_CONSTRUCT, getGroup()) == 0)
{
if (generatePath(pLoopCity->plot(), 0, true))
{
for (iI = 0; iI < GC.getNumBuildingClassInfos(); iI++)
{
BuildingTypes eBuilding = (BuildingTypes)GC.getCivilizationInfo(getCivilizationType()).getCivilizationBuildings(iI);
if (NO_BUILDING != eBuilding)
{
bool bDoesBuild = false;
if ((m_pUnitInfo->getForceBuildings(eBuilding))|| (m_pUnitInfo->getBuildings(eBuilding)))
{
bDoesBuild = true;
}
if (bDoesBuild && (pLoopCity->getNumBuilding(eBuilding) > 0))
{
iCount++;
if (iCount >= iMaxCount)
{
return false;
}
}
if (bDoesBuild && GET_PLAYER(getOwnerINLINE()).getBuildingClassCount((BuildingClassTypes)GC.getBuildingInfo(eBuilding).getBuildingClassType()) < iMaxSingleBuildingCount)
{
if (canConstruct(pLoopCity->plot(), eBuilding))
{
//iValue = pLoopCity->AI_buildingValue(eBuilding);
[COLOR="Green"]iValue = pLoopCity->AI_buildingValue(eBuilding)*5; // srpt encourage epics[/COLOR]
if ((iValue > iThreshold) && (iValue > iBestValue))
{
iBestValue = iValue;
pBestPlot = getPathEndTurnPlot();
pBestConstructPlot = pLoopCity->plot();
eBestBuilding = eBuilding;
}
}
}
}
}
}
}
}
}
}
if ((pBestPlot != NULL) && (pBestConstructPlot != NULL) && (eBestBuilding != NO_BUILDING))
{
if (atPlot(pBestConstructPlot))
{
getGroup()->pushMission(MISSION_CONSTRUCT, eBestBuilding);
return true;
}
else
{
FAssert(!atPlot(pBestPlot));
getGroup()->pushMission(MISSION_MOVE_TO, pBestPlot->getX_INLINE(), pBestPlot->getY_INLINE(), 0, false, false, MISSIONAI_CONSTRUCT, pBestConstructPlot);
return true;
}
}
return false;
}
void CvUnitAI::AI_prophetMove()
{
PROFILE_FUNC();
//if (AI_construct(1))
[COLOR="Green"]if (AI_construct(8)) // srpt encourage epics[/COLOR]
{
return;
}
if (AI_discover(true, true))
{
return;
}
if (AI_construct(3))
{
return;
}
int iGoldenAgeValue = (GET_PLAYER(getOwnerINLINE()).AI_calculateGoldenAgeValue() / (GET_PLAYER(getOwnerINLINE()).unitsRequiredForGoldenAge()));
int iDiscoverValue = std::max(1, getDiscoverResearch(NO_TECH));
if (((iGoldenAgeValue * 100) / iDiscoverValue) > 60)
{
if (AI_goldenAge())
{
return;
}
if (iDiscoverValue > iGoldenAgeValue)
{
if (AI_discover())
{
return;
}
if (GET_PLAYER(getOwnerINLINE()).getUnitClassCount(getUnitClassType()) > 1)
{
if (AI_join())
{
return;
}
}
}
}
else
{
if (AI_discover())
{
return;
}
if (AI_join())
{
return;
}
}
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 08/20/09 jdog5000 */
/* */
/* Unit AI, Efficiency */
/************************************************************************************************/
//if ((GET_PLAYER(getOwnerINLINE()).AI_getPlotDanger(plot(), 2) > 0) ||
if ((GET_PLAYER(getOwnerINLINE()).AI_getAnyPlotDanger(plot(), 2)) ||
/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/
(getGameTurnCreated() < (GC.getGameINLINE().getGameTurn() - 25)))
{
if (AI_discover())
{
return;
}
}
if (AI_retreatToCity())
{
return;
}
if (AI_safety())
{
return;
}
getGroup()->pushMission(MISSION_SKIP);
return;
}
self.lBarbarianList = [con.iAztecJaguar, con.iCongoPombos, con.iIncanQuechua, con.iSumerianVulture, con.iNativeAmericaDogSoldier, con.iZuluImpi, con.iIroquoisMohawk, con.iNubianMedjay, con.iMayaHolkan, con.iHittiteHuluganni, con.iCarthageNumidianCavalry, con.iKushanAsvaka, con.iTibetanKhampa, con.iMongolKeshik, con.iCamelArcher, con.iMandeFarari, con.iSiouxMountedBrave]
if self.iCivilization == con.iCivBarbarian:
screen.attachImageButton(panelName, "", gc.getUnitInfo([B]self.lBarbarianList[/B]).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_UNIT, [B]self.lBarbarianList[/B], 1, False)
self.lBarbarianList = [con.iAztecJaguar, con.iCongoPombos, con.iIncanQuechua, con.iSumerianVulture, con.iNativeAmericaDogSoldier, con.iZuluImpi, con.iIroquoisMohawk, con.iNubianMedjay, con.iMayaHolkan, con.iHittiteHuluganni, con.iCarthageNumidianCavalry, con.iKushanAsvaka, con.iTibetanKhampa, con.iMongolKeshik, con.iCamelArcher, con.iMandeFarari, con.iSiouxMountedBrave]
if self.iCivilization == con.iCivBarbarian:
[COLOR="Blue"]for iUnit in self.lBarbarianList:[/COLOR]
screen.attachImageButton(panelName, "", gc.getUnitInfo([COLOR="blue"]iUnit[/COLOR]).getButton(), GenericButtonSizes.BUTTON_SIZE_CUSTOM, WidgetTypes.WIDGET_PEDIA_JUMP_TO_UNIT, [COLOR="Blue"]iUnit[/COLOR], 1, False)