本文整理汇总了C++中CMonster::DoStand方法的典型用法代码示例。如果您正苦于以下问题:C++ CMonster::DoStand方法的具体用法?C++ CMonster::DoStand怎么用?C++ CMonster::DoStand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMonster
的用法示例。
在下文中一共展示了CMonster::DoStand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoStand
void CStateMachinen::DoStand(CMonster& monster, eStateEvent evt)
{
const BASE_MONSTER_LIST& baseMonsterList = monster.GetSMonsterList();
StateParameter& stateParamter = monster.mStateParamter;
switch(evt)
{
case eSEVENT_Enter:
{
// 소유주가 전투중인 경우 도와주러 간다
if(CObject* const ownerObject = g_pUserTable->FindUser(monster.GetOwnerIndex()))
{
if(ownerObject->GetObjectBattleState() &&
TRUE == monster.SetTObject(ownerObject->GetTObject()))
{
SetState(
&monster,
eMA_PERSUIT);
stateParamter.nextTime = gCurTime + 500;
break;
}
}
stateParamter.nextTime = gCurTime + baseMonsterList.StandTime;
monster.DoStand();
if(FALSE == monster.IsNoCheckCollision())
{
break;
}
VECTOR3 vPos = {0};
monster.GetPosition(&vPos);
if(g_pServerSystem->GetMap()->CollisionTilePos(
vPos.x,
vPos.z,
g_pServerSystem->GetMapNum()))
{
break;
}
monster.SetNoCheckCollision(FALSE);
break;
}
case eSEVENT_Process:
{
if(stateParamter.nextTime > gCurTime)
{
break;
}
Mon_SpeechState speechState = eMon_Speech_MAX;
const BYTE rate = BYTE(rand() % 100);
if(rate < baseMonsterList.StandRate)
{
SetState(
&monster,
eMA_STAND);
speechState = eMon_Speech_KeepWalkAround;
}
else
{
SetState(
&monster,
eMA_WALKAROUND);
speechState = eMon_Speech_WalkAround;
}
// 100617 ONS 정지상태에서 타겟이 죽었을 경우, 배회상태로 변경한다.
if( monster.GetTObject() && monster.GetTObject()->GetState() == eObjectState_Die )
{
monster.SetTObject(0);
SetState(
&monster,
eMA_WALKAROUND);
}
const MonSpeechInfo* const speechInfo = MON_SPEECHMGR->GetCurStateSpeechIndex(
monster.GetMonsterKind(),
speechState);
if(0 == speechInfo)
{
break;
}
monster.AddSpeech(
speechInfo->SpeechType,
speechInfo->SpeechIndex);
break;
}
}
}