本文整理汇总了C++中CAI::LinkCinematicTrigger方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI::LinkCinematicTrigger方法的具体用法?C++ CAI::LinkCinematicTrigger怎么用?C++ CAI::LinkCinematicTrigger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI
的用法示例。
在下文中一共展示了CAI::LinkCinematicTrigger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateDialogue
LTBOOL CinematicTrigger::UpdateDialogue()
{
if (!g_pLTServer) return LTFALSE;
// If we haven't yet done so, let all the cinematic participants know
// they're under CinematicTrigger control
if ( !m_bNotified )
{
for ( uint32 iWho = 0 ; iWho < MAX_CT_MESSAGES; iWho++ )
{
if ( m_hstrWhoPlaysDialogue[iWho] )
{
HOBJECT hWho;
if ( LT_OK == FindNamedObject(m_hstrWhoPlaysDialogue[iWho], hWho) )
{
if ( IsKindOf(hWho, "CAI") )
{
CAI* pAI = (CAI*)g_pLTServer->HandleToObject(hWho);
pAI->LinkCinematicTrigger(m_hObject);
}
}
}
}
m_bNotified = LTTRUE;
}
// Now update...
LTFLOAT fTime = g_pLTServer->GetTime();
// See if we are playing a dialogue...
BOOL bDone = FALSE;
if (m_hCurSpeaker)
{
// If sound is done, stop it and wait for new sound...
CCharacter* pChar = (CCharacter*)g_pLTServer->HandleToObject(m_hCurSpeaker);
if (pChar)
{
bDone = !pChar->IsPlayingDialogue();
}
}
if (bDone)
{
// Send message for our last reply (since the dialog is now done)...
if (m_byLastReply)
{
SendReplyMessage(m_byLastReply);
}
m_byLastReply = m_byDecision;
m_byDecision = 0;
// Clear our speaker...
g_pLTServer->BreakInterObjectLink(m_hObject, m_hCurSpeaker);
m_hCurSpeaker = LTNULL;
if(m_byLastReply)
{
return StartDialogue(m_byLastReply);
}
m_nCurMessage++;
if (m_nCurMessage < MAX_CT_MESSAGES)
{
m_fNextDialogueStart = fTime + m_fDelay[m_nCurMessage];
}
else
{
return LTFALSE;
}
}
if (!m_hCurSpeaker)
{
// See if we're done...
if (m_nCurMessage >= MAX_CT_MESSAGES || !m_hstrDialogue[m_nCurMessage])
{
return LTFALSE;
}
// Start next sound...
if (m_fNextDialogueStart >= 0.0f && m_fNextDialogueStart <= fTime)
{
return StartDialogue();
}
}
return LTTRUE;
}