本文整理汇总了C++中TMonsterAIUtil::FindPathToMoveMonster方法的典型用法代码示例。如果您正苦于以下问题:C++ TMonsterAIUtil::FindPathToMoveMonster方法的具体用法?C++ TMonsterAIUtil::FindPathToMoveMonster怎么用?C++ TMonsterAIUtil::FindPathToMoveMonster使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMonsterAIUtil
的用法示例。
在下文中一共展示了TMonsterAIUtil::FindPathToMoveMonster方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyElementGroupMove
BOOL TMonsterAIElement::ApplyElementGroupMove(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-그룹이동");
if ( lpObj->PathStartEnd )
return FALSE;
BOOL bFindXY = FALSE;
BOOL bFoundLeader = TRUE;
int iLeaderIndex = -1;
iLeaderIndex = TMonsterAIGroup::FindGroupLeader(lpObj->m_iGroupNumber);
if ( iLeaderIndex == -1 || gObj[iLeaderIndex].Live == FALSE )
bFoundLeader = FALSE;
if ( bFoundLeader && gObjCalDistance(lpObj, &gObj[iLeaderIndex]) > 6 )
{
lpObj->TargetNumber = iLeaderIndex;
bFindXY = MONSTER_UTIL.GetXYToChase(lpObj);
}
else if ( pAIState->m_iTransitionType == 2 )
{
bFindXY = MONSTER_UTIL.GetXYToChase(lpObj);
}
else
{
bFindXY = MONSTER_UTIL.GetXYToPatrol(lpObj);
}
if ( bFindXY )
{
if ( MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, TRUE) )
{
}
else
{
MONSTER_UTIL.GetXYToPatrol(lpObj);
MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, TRUE);
}
}
return FALSE;
}
示例2: ApplyElementAvoid
BOOL TMonsterAIElement::ApplyElementAvoid(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-회피");
KANTURU_UTIL.SendKanturuChattingMsg(iIndex, "Element-회피");
BOOL bFindXY = MONSTER_UTIL.GetXYToEascape(lpObj);
if ( bFindXY )
{
MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, 1);
}
return FALSE;
}
示例3: MoveProc
void CDoppelganger::MoveProc(LPOBJ lpObj)
{
if(DOPPELGANGER_MAP_RANGE(lpObj->MapNumber) && lpObj->Type == OBJ_MONSTER){
for(int X=0; X < this->MonstersCount;X++){
if(this->CurrentMonster[X] == lpObj->m_Index){
lpObj->MTX = this->PosX[this->EventMap-65];
lpObj->MTY = this->PosY[this->EventMap-65];
MonsterAIUtil.FindPathToMoveMonster(lpObj,lpObj->MTX,lpObj->MTY,15,2);
}
}
}
}
示例4: ApplyElementMove
BOOL TMonsterAIElement::ApplyElementMove(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-이동");
KANTURU_UTIL.SendKanturuChattingMsg(iIndex, "Element-이동");
if ( lpObj->PathStartEnd )
return FALSE;
BOOL bFindXY = FALSE;
if ( pAIState->m_iTransitionType == 2 )
bFindXY = MONSTER_UTIL.GetXYToChase(lpObj);
else
bFindXY = MONSTER_UTIL.GetXYToPatrol(lpObj);
if ( bFindXY )
MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, 1);
return FALSE;
}
示例5: ApplyElementMoveTarget
BOOL TMonsterAIElement::ApplyElementMoveTarget(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
LPOBJ lpObj = &gObj[iIndex];
UTIL.SendCrywolfChattingMsg(iIndex, "Element-MoveTarget");
#if (__CUSTOM__ == 0)
KANTURU_UTIL.SendKanturuChattingMsg(iIndex, "Element-타겟이동");
#endif
if ( lpObj->PathStartEnd )
return FALSE;
if ( lpObj->X == this->m_iX &&
lpObj->Y == this->m_iY )
{
this->ApplyElementMove(iIndex, iTargetIndex, pAIState);
return FALSE;
}
BOOL bFindXY = TRUE;
int iTargetX = this->m_iX;
int iTargetY = this->m_iY;
int iTargetDistance = (int)sqrt(double(((lpObj->X - iTargetX)*(lpObj->X - iTargetX))+ ((lpObj->Y - iTargetY)*(lpObj->Y - iTargetY))));
if ( TMonsterAIElement::s_MonsterAIMovePath[lpObj->MapNumber].m_bDataLoad )
{
if ( iTargetDistance > 10 )
{
int iMinCost = 1000000;
int iMidX = -1;
int iMidY = -1;
int iSpotNum = -1;
for ( int i=0;i<MAX_MONSTER_AI_MOVE_PATH;i++)
{
TMonsterAIMovePathInfo & PathInfo = TMonsterAIElement::s_MonsterAIMovePath[lpObj->MapNumber].m_MovePathInfo[i];
float fDistX = (float)(lpObj->X - PathInfo.m_iPathX);
float fDistY = (float)(lpObj->Y - PathInfo.m_iPathY);
int iPathSpotDist = (int)sqrt( (fDistX*fDistX) + (fDistY*fDistY) );
if ( iPathSpotDist < 20 )
{
fDistX = (float)(iTargetX - PathInfo.m_iPathX);
fDistY = (float)(iTargetY - PathInfo.m_iPathY);
int iMidDist = (int)sqrt( (fDistX*fDistX) + (fDistY*fDistY) );
if ( iMinCost > iMidDist )
{
if ( iMidDist )
{
iMinCost = iMidDist;
iMidX = PathInfo.m_iPathX;
iMidY = PathInfo.m_iPathY;
iSpotNum = i;
}
}
}
}
if ( iMinCost != 1000000 )
{
iTargetX = iMidX;
iTargetY = iMidY;
}
}
}
if ( bFindXY )
{
if ( MONSTER_UTIL.FindPathToMoveMonster(lpObj, iTargetX, iTargetY, 7, FALSE) )
lpObj->PathStartEnd = 1;
else
lpObj->PathStartEnd = 0;
}
return FALSE;
}