本文整理汇总了C++中CMover::SetDestObj方法的典型用法代码示例。如果您正苦于以下问题:C++ CMover::SetDestObj方法的具体用法?C++ CMover::SetDestObj怎么用?C++ CMover::SetDestObj使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMover
的用法示例。
在下文中一共展示了CMover::SetDestObj方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMover
void CAIMonster2::OnBeginState( int nInput, DWORD dwParam1, DWORD dwParam2 )
{
CMover* pMover = GetMover();
switch( GetState() )
{
case AI2_MOVE:
{
D3DXVECTOR3 vPos = m_vPosBegin;
int x = xRandom( 20 );
int z = xRandom( 20 );
vPos.x += (float)(x - 10);
vPos.z += (float)(z - 10);
MoveToDst( vPos ); // y는 어떻게 되나?
}
break;
case AI2_IDLE:
//m_dwReattack = GetTickCount() + xRandom( 0, 2000 );
m_dwReattack = GetTickCount() + 2000;
m_idTarget = NULL_ID;
m_vTarget.x = m_vTarget.y = m_vTarget.z = 0.0f;
pMover->SetStop();
MoveToDst( pMover->GetPos() );
break;
case AI2_ATTACK:
if( BeginAttack() == FALSE ) // 공격
SendAIMsg( AIMSG_END_MELEEATTACK, 0, 0 ); // 실패할 경우 공격완료 메세지는 오지 않는다.
break;
case AI2_TRACKING:
if( m_idTarget == NULL_ID )
{
m_idTarget = m_idLastAttacker;
ASSERT( m_idTarget != NULL_ID );
}
#ifdef __TRAFIC_1222
if( pMover->GetDestId() == m_idTarget )
break;
#endif // __TRAFIC_1222
// 이동할 목표물을 idTarget으로 설정.
pMover->SetDestObj( m_idTarget, m_fAttackRange );
g_UserMng.AddMoverSetDestObj( pMover, m_idTarget, m_fAttackRange );
break;
case AI2_SEARCH:
break;
}
}
示例2: if
//.........这里部分代码省略.........
//if( !pMover->IsEmptyDestPos() || !pMover->IsEmptyDestObj() )
// return nMsg;
#ifdef __Y_INTERFACE_VER3
if( bUp || bDown || bLeft || bRight || bSpace || bLForward || bRForward ) // 이동 키조작이 들어가면 자동공격 멈춤.
#else //__Y_INTERFACE_VER3
if( bUp || bDown || bLeft || bRight || bSpace ) // 이동 키조작이 들어가면 자동공격 멈춤.
#endif //__Y_INTERFACE_VER3
{
if( bUp || bDown )
#if __VER >= 12 // __MOD_TUTORIAL
{
CWndGuideSystem* pWndGuide = NULL;
pWndGuide = (CWndGuideSystem*)GetWndBase( APP_GUIDE );
if(pWndGuide && pWndGuide->IsVisible()) pWndGuide->m_Condition.bIsKeyMove = true;
}
#else
m_pWndGuideSystem->SendGuideMessage(GUIDE_EVENT_KEY_MOVE);
#endif
m_bAutoAttack = FALSE;
g_pPlayer->ClearCmd();
if( !bSpace )
m_objidTracking = NULL_ID;
}
if( m_objidTracking != NULL_ID )
{
CMover* pObjTracking = prj.GetMover( m_objidTracking );
if( pObjTracking )
{
D3DXVECTOR3 vDis = pMover->GetPos() - pObjTracking->GetPos();
if( D3DXVec3LengthSq( &vDis ) > 16 )
pMover->SetDestObj( m_objidTracking );
}
else
m_objidTracking = NULL_ID;
}
bool fMoved = false;
bool fBehavior = false;
if( bUp ) {
if( pMover->SendActMsg( OBJMSG_FORWARD ) == 1 ) {
fMoved = true;
fCastCancel = true;
}
}
else if( bDown ) {
if( pMover->SendActMsg( OBJMSG_BACKWARD ) == 1 ) {
fMoved = true;
fCastCancel = true;
}
}
#ifdef __Y_INTERFACE_VER3
else
if( bLForward ) {
if( pMover->SendActMsg( OBJMSG_LFORWARD ) == 1 ) {
fMoved = true;
fCastCancel = true;
}
}
else if( bRForward ) {
if( pMover->SendActMsg( OBJMSG_RFORWARD ) == 1 ) {
fMoved = true;
fCastCancel = true;