本文整理汇总了C++中Damage::getValues方法的典型用法代码示例。如果您正苦于以下问题:C++ Damage::getValues方法的具体用法?C++ Damage::getValues怎么用?C++ Damage::getValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Damage
的用法示例。
在下文中一共展示了Damage::getValues方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyAttackRelativeBonnus
void Attributs::applyAttackRelativeBonnus(Damage &damage) const
{
for(unsigned i=0; i<damage.getValues().size() ; i++)
{
for(unsigned a=0 ; a<relativeFightBonus.size() ; a++)
{
if(damage.getValues().at(i).getType() == relativeFightBonus.at(a).getType() )
{
int newDamage = damage.getValues().at(i).getValue();
newDamage += (newDamage * relativeFightBonus.at(a).getValue()) / 100; //one value point -> add 1% damage
damage.getValues().at(i).setValue(newDamage);
}
}
}
}
示例2: applyAttackFixBonnus
void Attributs::applyAttackFixBonnus(Damage &damage) const
{
for(unsigned i=0; i<damage.getValues().size() ; i++)
{
int newDamage = damage.getValues().at(i).getValue();
newDamage += fixDamageBonnus;
for(unsigned a=0 ; a<fixFightBonus.size() ; a++)
{
if(damage.getValues().at(i).getType() == fixFightBonus.at(a).getType() )
{
newDamage += fixFightBonus.at(a).getValue(); //add fix attack bonnus
//exit for loop: (there are only one couple)
a = values.size();
}
}
damage.getValues().at(i).setValue(newDamage);
}
}
示例3: applyDefenseRelativeResistances
void Attributs::applyDefenseRelativeResistances(Damage &damage) const
{
for(unsigned i=0; i<damage.getValues().size() ; i++)
{
for(unsigned a=0 ; a<relativeResistances.size() ; a++)
{
if(damage.getValues().at(i).getType() == relativeResistances.at(a).getType() )
{
int newDamage = damage.getValues().at(i).getValue();
newDamage -= (newDamage * relativeResistances.at(a).getValue()) / 100; //one value point -> add 1% resistances
if(newDamage<0)
{
newDamage = 0;
}
damage.getValues().at(i).setValue(newDamage);
}
}
}
}
示例4: applyDefenseFixResistances
void Attributs::applyDefenseFixResistances(Damage &damage) const
{
for(unsigned i=0; i<damage.getValues().size() ; i++)
{
for(unsigned a=0 ; a<fixResistances.size() ; a++)
{
if(damage.getValues().at(i).getType() == fixResistances.at(a).getType() )
{
int newDamage = damage.getValues().at(i).getValue();
newDamage -= fixResistances.at(a).getValue(); //add fix attack bonnus
if(newDamage<0)
{
newDamage = 0;
}
damage.getValues().at(i).setValue(newDamage);
}
}
}
}
示例5: applyAttackValues
void Attributs::applyAttackValues(Damage &damage) const
{
for(unsigned i=0; i<damage.getValues().size() ; i++)
{
int newDamage = damage.getValues().at(i).getValue();
int damageBonnus = powerBonnus;
for(unsigned a=0 ; a<values.size() ; a++)
{
if(damage.getValues().at(i).getType() == values.at(a).getType() )
{
damageBonnus += values.at(a).getValue(); //one value point -> add 1% damage
//exit for loop: (there are only one couple)
a = values.size();
}
}
newDamage += newDamage*damageBonnus/100;
damage.getValues().at(i).setValue(newDamage);
}
}