本文整理汇总了C++中Bottle::getHurt方法的典型用法代码示例。如果您正苦于以下问题:C++ Bottle::getHurt方法的具体用法?C++ Bottle::getHurt怎么用?C++ Bottle::getHurt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bottle
的用法示例。
在下文中一共展示了Bottle::getHurt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attactMonsterArrange
//.........这里部分代码省略.........
// 怪物处于无敌状态
continue;
}
lifeHurt = countAttValMonster(mon, skiHrtRatio, 1);
sprintf(tempMsg + strlen(tempMsg), ",%s,%d,%d,%d,%d,%d,%d", mon->getIdentity(),
JUDGE_WILL_LIFE(mon, lifeHurt), mon->getLifeUpperVal(), 100,100, lifeHurt, 0);
atkNum++;
proc_mon_lose_life(owner, mon, lifeHurt);
}
}
if (oneScr->wagonSet.size() != 0 && owner->gethero_PK_status() != PEACE_MODE)
{
set<string>::iterator it_wagonId;
tempSet.clear();
tempSet = oneScr->wagonSet;
for (it_wagonId = tempSet.begin(); it_wagonId != tempSet.end(); it_wagonId++)
{
cout<<"attack one wagon and wagonId is "<<(*it_wagonId)<<endl;
Wagon* wagon = NULL;
map<string, Wagon*>::iterator it_wagon;
it_wagon = wagonInstMap.find(*it_wagonId);
if (it_wagon == wagonInstMap.end())
{
continue;
}
wagon = it_wagon->second;
if (wagon == NULL)
{
continue;
}
if (wagon->getLifeVal() <= 0)
{
// 怪物已经死亡
continue;
}
Hero *wagonOwner = wagon->getOwner();
if (wagonOwner != NULL && strcmp(wagonOwner->getIdentity(), owner->getIdentity()) == 0)
{
// 自己的马车不能攻击
continue;
}
tempPt = wagon->getLocation();
if (IS_OUT_RANGE(tempPt, objPt, range))
{
// 不在作用范围内
continue;
}
lifeHurt = wagon->getHurt();
sprintf(tempMsg + strlen(tempMsg), ",%s,%d,%d,%d,%d,%d,%d", wagon->getIdentity(),
JUDGE_WILL_LIFE(wagon, lifeHurt), wagon->getLifeUpperVal(), 100, 100, lifeHurt, 0);
atkNum++;
proc_wagon_lose_life(owner, wagon, lifeHurt);
}
}
if (oneScr->bottleSet.size() != 0)
{
set<string>::iterator it_bottleId;
tempSet.clear();
tempSet = oneScr->bottleSet;
for (it_bottleId = tempSet.begin(); it_bottleId != tempSet.end(); it_bottleId++)
{
cout<<"attack one bottle and bottleId is "<<(*it_bottleId)<<endl;
Bottle *bottInst = NULL;
bottInst = mapNow->getBotInst(const_cast<char*>((*it_bottleId).c_str()));
if (bottInst == NULL)
{
continue;
}
if (bottInst->getLifeVal() <= 0)
{
// 怪物已经死亡
continue;
}
tempPt = bottInst->getPiexPt();
if (IS_OUT_RANGE(tempPt, objPt, range))
{
// 不在作用范围内
continue;
}
lifeHurt = bottInst->getHurt();
sprintf(tempMsg + strlen(tempMsg), ",%s,%d,%d,%d,%d,%d,%d", bottInst->getId(),
JUDGE_WILL_LIFE(bottInst, lifeHurt), bottInst->getLifeUpperVal(),100, 100, lifeHurt, 0);
atkNum++;
proc_bottle_lose_life(owner, bottInst, lifeHurt);
}
}
}
sprintf(msg + strlen(msg), ",%d%s",atkNum, tempMsg);
send_nine_msg(owner, msg);
}