Fimbulvetr
Emperor
No. Ever heard of function overloading?
if (lResult == 1)
{
/************************************************************************************************/
/* UNOFFICIAL_PATCH 03/01/10 Mongoose & jdog5000 */
/* */
/* Bugfix */
/************************************************************************************************/
/* original bts code
if (pPlot->getFeatureType() != NO_FEATURE)
*/
// From Mongoose SDK
// Don't remove floodplains from tiles when founding city
//if ((pPlot->getFeatureType() != NO_FEATURE) && (pPlot->getFeatureType() != (FeatureTypes)GC.getInfoTypeForString("FEATURE_FLOOD_PLAINS")))
if (pPlot->getFeatureType() != NO_FEATURE)
/************************************************************************************************/
/* UNOFFICIAL_PATCH END */
/************************************************************************************************/
{
pPlot->setFeatureType(NO_FEATURE);
}
}
Instead of leaving floodplains when founding a city, floodplains are simply being re-added when a city on desert next to river is destroyed, see CvCity::kill() .
This Unofficial Patch change was requested by EmperorFool because getting 3 food from city tile when settling on fp is altering the game rules and thus couldn't be part of BULL.
iValue = 0;
if (GC.getGameINLINE().isOption(GAMEOPTION_ALWAYS_PEACE))
{
iValue += 30;
}
iValue += (GC.getGameINLINE().isOption(GAMEOPTION_AGGRESSIVE_AI) ? -20 : 0);
if( iValue > 20 && getNumCities() >= GC.getGameINLINE().culturalVictoryNumCultureCities() )
{
iValue += 10*countHolyCities();
}
int iNonsense = AI_getStrategyRand() + 10;
iValue += (iNonsense % 100);
if (iValue < 100)
{
return 0;
}
if (GC.getGame().getStartEra() > 1)
{
return 0;
}
AI refuses to take empty cities.
This more like a question rather than a bug report.
I'm using Better AI (1.00 IIRC) in my mod. I have done quite a few SDK changes but I don't think they affect this.
In my test game I'm a super power and have two vassals. My question is why one of the AIs doesn't have any victory strategies? He's the weakest player in the game and vassal of Poland (not me). What is the reason for it, because even my vassals have victory strategies? Has he given up?![]()
OK. My bad on the CultureVictory function. I must have messed with the code and forgot to change it back (or perhaps I had an old version). I do see that you're pulling the Leader's Culture Victory Weight to get an initial iValue. So ignore the first part of my post.
However, I am still confused by the Advanced Start section.
AI refuses to take empty cities.
if( GET_PLAYER(getOwnerINLINE()).AI_cityTargetUnitsByPath(pLoopCity, getGroup(), iPathTurns) > 3 * pLoopCity->plot()->getNumVisibleEnemyDefenders(this) )
if( GET_PLAYER(getOwnerINLINE()).AI_cityTargetUnitsByPath(pLoopCity, getGroup(), iPathTurns) > std::max( 6, 3 * pLoopCity->plot()->getNumVisibleEnemyDefenders(this)) )
if (bAttack)
{
/************************************************************************************************/
/* BETTER_BTS_AI_MOD 06/14/10 jdog5000 */
/* */
/* Efficiency */
/************************************************************************************************/
// From Lead From Behind by UncutDragon
// original
//CvUnit* pDefender = pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), this, true);
//if (NULL != pDefender)
//{
// if (!canAttack(*pDefender))
// {
// return false;
// }
//}
// modified
if( combatLimit() < 100 )
{
CvUnit* pDefender = pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), this, true);
if (NULL != pDefender)
{
if (!canAttack(*pDefender))
{
return false;
}
}
}
else if (!pPlot->hasDefender(true, NO_PLAYER, getOwnerINLINE(), this, true))
{
return false;
}
/************************************************************************************************/
/* BETTER_BTS_AI_MOD END */
/************************************************************************************************/
}
else if (!pPlot->hasDefender(true, NO_PLAYER, getOwnerINLINE(), this, true))
{
return false;
}
//CvUnit* pDefender = pPlot->getBestDefender(NO_PLAYER, getOwnerINLINE(), this, true);
//if (NULL != pDefender)
//{
// if (!canAttack(*pDefender))
// {
// return false;
// }
//}
- Added AI_STRATEGY_ALERT1 and AI_STRATEGY_ALERT2, AI will now analyze if it might be attacked in the near future and take pre-emptive action