本文整理汇总了C++中CvPromotionEntry::IsMustSetUpToRangedAttack方法的典型用法代码示例。如果您正苦于以下问题:C++ CvPromotionEntry::IsMustSetUpToRangedAttack方法的具体用法?C++ CvPromotionEntry::IsMustSetUpToRangedAttack怎么用?C++ CvPromotionEntry::IsMustSetUpToRangedAttack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvPromotionEntry
的用法示例。
在下文中一共展示了CvPromotionEntry::IsMustSetUpToRangedAttack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoUpdatePower
//.........这里部分代码省略.........
// Attack - add half of the bonus
if(kPromotion->GetAttackMod() > 0)
{
iTemp = (iPower * kPromotion->GetAttackMod() / 2);
iTemp /= 100;
iPower += iTemp;
}
// Defense - add half of the bonus
if(kPromotion->GetDefenseMod() > 0)
{
iTemp = (iPower * kPromotion->GetDefenseMod() / 2);
iTemp /= 100;
iPower += iTemp;
}
// Paradrop - add 25%
if(kPromotion->GetDropRange() > 0)
{
iTemp = iPower;
iTemp /= 4;
iPower += iTemp;
}
// Blitz - add 20%
if(kPromotion->IsBlitz())
{
iTemp = iPower;
iTemp /= 5;
iPower += iTemp;
}
// Set Up For Ranged Attack - reduce by 20%
if(kPromotion->IsMustSetUpToRangedAttack())
{
iTemp = iPower;
iTemp /= 5;
iPower -= iTemp;
}
// Only Defensive - reduce by 25%, but only if the Unit has no ranged capability
if(kPromotion->IsOnlyDefensive() && GetRangedCombat() == 0)
{
iTemp = iPower;
iTemp /= 4;
iPower -= iTemp;
}
for(iLoop = 0; iLoop < GC.getNumTerrainInfos(); iLoop++)
{
// Terrain Attack - add one quarter of the bonus
if(kPromotion->GetTerrainAttackPercent(iLoop) > 0)
{
iTemp = (iPower * kPromotion->GetTerrainAttackPercent(iLoop) / 4);
iTemp /= 100;
iPower += iTemp;
}
// Terrain Defense - add one quarter of the bonus
if(kPromotion->GetTerrainDefensePercent(iLoop) > 0)
{
iTemp = (iPower * kPromotion->GetTerrainDefensePercent(iLoop) / 4);
iTemp /= 100;
iPower += iTemp;
}
}