本文整理汇总了C++中CMonster::DoSearch方法的典型用法代码示例。如果您正苦于以下问题:C++ CMonster::DoSearch方法的具体用法?C++ CMonster::DoSearch怎么用?C++ CMonster::DoSearch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMonster
的用法示例。
在下文中一共展示了CMonster::DoSearch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SubProcess
void CStateMachinen::SubProcess(CMonster& monster, eStateEvent evt)
{
const BASE_MONSTER_LIST& baseMonsterList = monster.GetSMonsterList();
StateParameter& stateParamter = monster.mStateParamter;
if( monster.GetAbnormalStatus()->IsStun ||
monster.GetAbnormalStatus()->IsFreezing ||
monster.GetAbnormalStatus()->IsStone ||
monster.GetAbnormalStatus()->IsSlip ||
monster.GetAbnormalStatus()->IsParalysis )
{
return;
}
switch(stateParamter.stateCur)
{
case eMA_STAND:
case eMA_WALKAROUND:
{
const cActiveSkillInfo* const skillInfo = baseMonsterList.SkillInfo[monster.mStateParamter.CurAttackKind];
if(0 == skillInfo)
{
break;
}
CObject* object = 0;
if(monster.IsForeAttack() &&
(stateParamter.SearchLastTime < gCurTime))
{
stateParamter.SearchLastTime = gCurTime + baseMonsterList.SearchPeriodicTime;
CObject* const ownerObject = g_pUserTable->FindUser(monster.GetOwnerIndex());
if(0 == ownerObject)
{
object = monster.DoSearch();
}
else if(eObjectKind_Player == ownerObject->GetObjectKind())
{
object = monster.DoFriendSearch(
skillInfo->GetInfo().Range);
}
else if(eObjectKind_Monster & ownerObject->GetObjectKind())
{
object = monster.DoSearch();
}
}
else if(baseMonsterList.AttackNum &&
(stateParamter.CollSearchLastTime < gCurTime))
{
stateParamter.CollSearchLastTime = gCurTime + 500;
CObject* const ownerObject = g_pUserTable->FindUser(monster.GetOwnerIndex());
if(0 == ownerObject)
{
break;
}
else if(eObjectKind_Player == ownerObject->GetObjectKind())
{
object = monster.DoFriendSearch(
skillInfo->GetInfo().Range);
}
else if(eObjectKind_Monster & ownerObject->GetObjectKind())
{
object = monster.DoSearch();
}
}
if(0 == object)
{
break;
}
else if(FALSE == monster.SetTObject(object))
{
break;
}
SetState(
&monster,
eMA_PERSUIT);
}
break;
}
}