本文整理汇总了C++中CvPlot::IsNaturalWonder方法的典型用法代码示例。如果您正苦于以下问题:C++ CvPlot::IsNaturalWonder方法的具体用法?C++ CvPlot::IsNaturalWonder怎么用?C++ CvPlot::IsNaturalWonder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvPlot
的用法示例。
在下文中一共展示了CvPlot::IsNaturalWonder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlotFoundValue
//.........这里部分代码省略.........
iScienceValue = ComputeScienceValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_SCIENCE_MULTIPLIER();
if (eYield == NO_YIELD || eYield == YIELD_FAITH)
iFaithValue = ComputeFaithValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_FAITH_MULTIPLIER();
if (pLoopPlot->getOwner() == NO_PLAYER) // there is no benefit if we already own these tiles
{
iHappinessValue = ComputeHappinessValue(pLoopPlot, pPlayer) * /*6*/ GC.getSETTLER_HAPPINESS_MULTIPLIER();
iResourceValue = ComputeTradeableResourceValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_RESOURCE_MULTIPLIER();
if (iDistance)
iStrategicValue = ComputeStrategicValue(pLoopPlot, pPlayer, iDistance) * /*1*/ GC.getSETTLER_STRATEGIC_MULTIPLIER(); // the ring is included in the computation
}
iTotalFoodValue += iFoodValue;
iTotalHappinessValue += iHappinessValue;
iTotalProductionValue += iProductionValue;
iTotalGoldValue += iGoldValue;
iTotalScienceValue += iScienceValue;
iTotalFaithValue += iFaithValue;
iTotalResourceValue += iResourceValue;
iTotalStrategicValue += iStrategicValue;
iPlotValue += iRingModifier * ( iFoodValue + iHappinessValue + iProductionValue + iGoldValue + iScienceValue + iFaithValue + iResourceValue ) + iStrategicValue;
}
// for the central plot
if (iDistance==0)
vQualifiersPositive.push_back( CvString::format("raw plot value %d", iPlotValue).c_str() );
if (iDistance==1 && !pPlot->isCoastalLand(GC.getMIN_WATER_SIZE_FOR_OCEAN()) && pLoopPlot->isCoastalLand(GC.getMIN_WATER_SIZE_FOR_OCEAN()))
bIsAlmostCoast = true;
// if this tile is a NW boost the value just so that we force the AI to claim them (if we can work it)
if (pLoopPlot->IsNaturalWonder() && iPlotValue>0)
iPlotValue *= 15;
// lower value a lot if we already own this tile
if (iPlotValue > 0 && pLoopPlot->getOwner() == ePlayer && ePlayer != NO_PLAYER)
iPlotValue /= 2;
// add this plot into the total
workablePlots.push_back( SPlotWithScore(pLoopPlot,iPlotValue) );
// some civ-specific checks
FeatureTypes ePlotFeature = pLoopPlot->getFeatureType();
ImprovementTypes ePlotImprovement = pLoopPlot->getImprovementType();
ResourceTypes ePlotResource = pLoopPlot->getResourceType();
if (ePlotFeature == FEATURE_FOREST)
{
if (iDistance <= 5)
{
++iIroquoisForestCount;
if (iDistance == 1)
if (ePlotImprovement == NO_IMPROVEMENT)
++iCelticForestCount;
}
}
else if (ePlotFeature == FEATURE_JUNGLE)
{
if (iDistance <= iRange)
++iBrazilJungleCount;
}
else if (ePlotFeature == FEATURE_MARSH || ePlotFeature == FEATURE_FLOOD_PLAINS)
{
if (iDistance <= iRange)
示例2: PlotFoundValue
//.........这里部分代码省略.........
iFaithValue = iRingModifier * ComputeFaithValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_FAITH_MULTIPLIER();
}
}
// whether or not we are working these we get the benefit as long as culture can grow to take them
if (iDistance <= 5 && pLoopPlot->getOwner() == NO_PLAYER) // there is no benefit if we already own these tiles
{
iHappinessValue = iRingModifier * ComputeHappinessValue(pLoopPlot, pPlayer) * /*6*/ GC.getSETTLER_HAPPINESS_MULTIPLIER();
iResourceValue = iRingModifier * ComputeTradeableResourceValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_RESOURCE_MULTIPLIER();
if (iDistance)
iStrategicValue = ComputeStrategicValue(pLoopPlot, pPlayer, iDistance) * /*1*/ GC.getSETTLER_STRATEGIC_MULTIPLIER(); // the ring is included in the computation
}
iTotalFoodValue += iFoodValue;
iTotalHappinessValue += iHappinessValue;
iTotalProductionValue += iProductionValue;
iTotalGoldValue += iGoldValue;
iTotalScienceValue += iScienceValue;
iTotalFaithValue += iFaithValue;
iTotalResourceValue += iResourceValue;
iTotalStrategicValue += iStrategicValue;
int iPlotValue = iFoodValue + iHappinessValue + iProductionValue + iGoldValue + iScienceValue + iFaithValue + iResourceValue;
if (iPlotValue == 0)
{
// this tile is so bad it gets negatives
iPlotValue -= iRingModifier * GC.getSETTLER_FOOD_MULTIPLIER() * 2;
}
iPlotValue += iStrategicValue;
// if this tile is a NW boost the value just so that we force the AI to claim them (if we can work it)
#if defined(MOD_GLOBAL_CITY_WORKING)
if (pLoopPlot->IsNaturalWonder() && iDistance > 0 && iDistance <= pPlayer->getWorkPlotDistance())
#else
if (pLoopPlot->IsNaturalWonder() && iDistance > 0 && iDistance <= NUM_CITY_RINGS)
#endif
{
//iPlotValue += iPlotValue * 2 + 10;
iPlotValue += iPlotValue * 2 + 500;
}
// lower value a lot if we already own this tile
if (iPlotValue > 0 && pLoopPlot->getOwner() == pPlayer->GetID())
{
#if defined(MOD_BALANCE_CORE_SETTLER)
if (MOD_BALANCE_CORE_SETTLER)
{
iPlotValue *= 2;
iPlotValue /= 3;
}
#else
iPlotValue /= 4;
#endif
}
// add this plot into the total
rtnValue += iPlotValue;
FeatureTypes ePlotFeature = pLoopPlot->getFeatureType();
ImprovementTypes ePlotImprovement = pLoopPlot->getImprovementType();
ResourceTypes ePlotResource = pLoopPlot->getResourceType();
if (ePlotFeature == FEATURE_FOREST)
{
if (iDistance <= 5)
示例3: PlotFoundValue
//.........这里部分代码省略.........
{
iFaithValue = iRingModifier * ComputeFaithValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_FAITH_MULTIPLIER();
}
}
// whether or not we are working these we get the benefit as long as culture can grow to take them
if (iDistance <= 5 && pLoopPlot->getOwner() == NO_PLAYER) // there is no benefit if we already own these tiles
{
iHappinessValue = iRingModifier * ComputeHappinessValue(pLoopPlot, pPlayer) * /*6*/ GC.getSETTLER_HAPPINESS_MULTIPLIER();
iResourceValue = iRingModifier * ComputeTradeableResourceValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_RESOURCE_MULTIPLIER();
if (iDistance)
iStrategicValue = ComputeStrategicValue(pLoopPlot, pPlayer, iDistance) * /*1*/ GC.getSETTLER_STRATEGIC_MULTIPLIER(); // the ring is included in the computation
}
iTotalFoodValue += iFoodValue;
iTotalHappinessValue += iHappinessValue;
iTotalProductionValue += iProductionValue;
iTotalGoldValue += iGoldValue;
iTotalScienceValue += iScienceValue;
iTotalFaithValue += iFaithValue;
iTotalResourceValue += iResourceValue;
iTotalStrategicValue += iStrategicValue;
int iPlotValue = iFoodValue + iHappinessValue + iProductionValue + iGoldValue + iScienceValue + iFaithValue + iResourceValue;
if (iPlotValue == 0)
{
// this tile is so bad it gets negatives
iPlotValue -= iRingModifier * GC.getSETTLER_FOOD_MULTIPLIER() * 2;
}
iPlotValue += iStrategicValue;
// if this tile is a NW boost the value just so that we force the AI to claim them (if we can work it)
if (pLoopPlot->IsNaturalWonder() && iDistance > 0 && iDistance <= NUM_CITY_RINGS)
{
iPlotValue += iPlotValue * 2 + 10;
}
// lower value a lot if we already own this tile
if (iPlotValue > 0 && pLoopPlot->getOwner() == pPlayer->GetID())
{
iPlotValue /= 4;
}
// add this plot into the total
rtnValue += iPlotValue;
if (pLoopPlot->getFeatureType() == FEATURE_FOREST)
{
if (iDistance <= 5)
{
++iIroquoisForestCount;
if (iDistance == 1)
{
if (pLoopPlot->getImprovementType() == NO_IMPROVEMENT)
{
++iCelticForestCount;
}
}
}
}
}
}
else // this tile is owned by someone else
{
// See if there are other cities nearby (only count major civs)