本文整理汇总了C++中Skill::getSkillEffect方法的典型用法代码示例。如果您正苦于以下问题:C++ Skill::getSkillEffect方法的具体用法?C++ Skill::getSkillEffect怎么用?C++ Skill::getSkillEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Skill
的用法示例。
在下文中一共展示了Skill::getSkillEffect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attack
void Character::attack(Character* character, int idSkill )
{
Skill* skill = ObjectList::lSkill.at( idSkill );
std::cout << "\nLe sort " << skill->getName() << " est lance par " << this->m_name <<
" sur " << character->m_name << '\n' << skill->getPunchline() << '\n';
switch( skill->getSkillEffect() )
{
case PHYS_ATT :
{
int thisAtt = (skill->getPower() + this->m_stat.physicalAtt);
thisAtt = thisAtt - character->m_stat.physicalDef/4;
if( thisAtt < 1 )
{
thisAtt = 1;
}
character->m_stat.life -= thisAtt;
std::cout << character->m_name << " se voit inflige -" << thisAtt << "PV.\n";
break;
}
case MAG_ATT :
{
int thisAtt = (skill->getPower() + this->m_stat.magicalAtt);
thisAtt = thisAtt - character->m_stat.magicalDef/4;
if( thisAtt < 1 )
{
thisAtt = 1;
}
this->m_stat.mana--;
character->m_stat.life -= thisAtt;
std::cout << character->m_name << " se voit inflige -" << thisAtt << "PV.\n";
break;
}
case HEAL :
this->m_stat.mana--;
character->m_stat.life += skill->getPower();
std::cout << character->m_name << " recoit +" << skill->getPower() << "PV.\n";
break;
default :
std::cout << "TADADADAAAAMMM !!";
std::exit(17);
}
std::cout << "Vie de " << character->m_name << " : " << character->m_stat.life << "PV.\n";
}