本文整理汇总了C++中CMonster::RemoveAllAggro方法的典型用法代码示例。如果您正苦于以下问题:C++ CMonster::RemoveAllAggro方法的具体用法?C++ CMonster::RemoveAllAggro怎么用?C++ CMonster::RemoveAllAggro使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMonster
的用法示例。
在下文中一共展示了CMonster::RemoveAllAggro方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoRunAway
void CStateMachinen::DoRunAway(CMonster& monster, eStateEvent evt)
{
StateParameter& stateParamter = monster.mStateParamter;
if( monster.GetAbnormalStatus()->IsStun ||
monster.GetAbnormalStatus()->IsFreezing ||
monster.GetAbnormalStatus()->IsStone ||
monster.GetAbnormalStatus()->IsSlip ||
monster.GetAbnormalStatus()->IsMoveStop ||
monster.GetAbnormalStatus()->IsParalysis )
{
return;
}
switch(evt)
{
case eSEVENT_Enter:
{
monster.RemoveAllAggro();
monster.SetTObject(0);
VECTOR3 position = {0};
position.x = float(monster.GetFiniteStateMachine().GetMemory().GetVariable(
"__runaway_x__"));
position.z = float(monster.GetFiniteStateMachine().GetMemory().GetVariable(
"__runaway_z__"));
monster.OnMove(
&position);
stateParamter.nextTime = gCurTime + CCharMove::GetMoveEstimateTime(&monster) + 1000;
break;
}
case eSEVENT_Process:
{
if(gCurTime > stateParamter.nextTime)
{
SetState(
&monster,
eMA_STAND);
break;
}
break;
}
}
}
示例2: DoPursuit
void CStateMachinen::DoPursuit(CMonster& monster, eStateEvent evt)
{
const BASE_MONSTER_LIST& baseMonsterList = monster.GetSMonsterList();
StateParameter& stateParamter = monster.mStateParamter;
if(0 == baseMonsterList.SkillInfo[stateParamter.CurAttackKind])
{
SetState(
&monster,
eMA_STAND);
return;
}
else if(0 == monster.GetTObject() ||
(monster.GetTObject() && (eObjectState_Die == monster.GetTObject()->GetState())) ||
FALSE == monster.GetTObject()->GetInited())
{
SetState(
&monster,
eMA_STAND);
return;
}
else if( monster.GetAbnormalStatus()->IsStun ||
monster.GetAbnormalStatus()->IsFreezing ||
monster.GetAbnormalStatus()->IsStone ||
monster.GetAbnormalStatus()->IsSlip ||
monster.GetAbnormalStatus()->IsMoveStop ||
monster.GetAbnormalStatus()->IsParalysis )
{
return;
}
switch(evt)
{
case eSEVENT_Enter:
{
stateParamter.PursuitForgiveStartTime = gCurTime + baseMonsterList.PursuitForgiveTime;
stateParamter.nextTime = gCurTime + 1000;
monster.DoPursuit();
RandCurAttackKind(
baseMonsterList,
stateParamter);
monster.SetNoCheckCollision(TRUE);
break;
}
case eSEVENT_Process:
{
VECTOR3 ObjectPos = *CCharMove::GetPosition(&monster);
VECTOR3 TObjectPos = *CCharMove::GetPosition(monster.GetTObject());
DWORD Distance = 0;
float fDist = CalcDistanceXZ( &ObjectPos, &TObjectPos ) - monster.GetRadius();
if( fDist > 0.f )
{
Distance = (DWORD)fDist;
}
if( stateParamter.prePursuitForgiveTime == 0 && ( stateParamter.PursuitForgiveStartTime < gCurTime ||
baseMonsterList.PursuitForgiveDistance < Distance ) )
{
monster.RemoveAllAggro();
stateParamter.SearchLastTime = gCurTime + 3000; //3초간 선공몹 서치를 안하게 하기 위해서.
SetState(
&monster,
eMA_WALKAROUND);
MonSpeechInfo* pTemp = MON_SPEECHMGR->GetCurStateSpeechIndex( monster.GetMonsterKind(), eMon_Speech_ForgivePursuit );
if( pTemp )
monster.AddSpeech( pTemp->SpeechType, pTemp->SpeechIndex );
}
else if( Distance < baseMonsterList.SkillInfo[stateParamter.CurAttackKind]->GetInfo().Range )
{
SetState(
&monster,
eMA_ATTACK);
break;
}
else if( stateParamter.nextTime > gCurTime )
{
break;
}
stateParamter.nextTime = gCurTime + 1000;
monster.DoPursuit();
RandCurAttackKind(
baseMonsterList,
stateParamter);
break;
}
}
}