当前位置: 首页>>代码示例>>C++>>正文


C++ CAI::LinkCinematicTrigger方法代码示例

本文整理汇总了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;
}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:100,代码来源:CinematicTrigger.cpp


注:本文中的CAI::LinkCinematicTrigger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。