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


C++ Speak函数代码示例

本文整理汇总了C++中Speak函数的典型用法代码示例。如果您正苦于以下问题:C++ Speak函数的具体用法?C++ Speak怎么用?C++ Speak使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Speak函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetExpresser

void CAI_PlayerAlly::OnChangeRunningBehavior( CAI_BehaviorBase *pOldBehavior,  CAI_BehaviorBase *pNewBehavior )
{
	BaseClass::OnChangeRunningBehavior( pOldBehavior,  pNewBehavior );
	CAI_FollowBehavior *pFollowBehavior;
	if ( dynamic_cast<CAI_FollowBehavior *>(pNewBehavior) != NULL )
	{
		GetExpresser()->SetSpokeConcept( TLK_HELLO, NULL );	// Don't say hi after you've started following
		if ( IsOkToCombatSpeak() )
			Speak( TLK_USE );
		SetSpeechTarget( GetTarget() );
		ClearCondition( COND_PLAYER_PUSHING );
	}
	else if ( ( pFollowBehavior = dynamic_cast<CAI_FollowBehavior *>(pOldBehavior) ) != NULL  )
	{
		if ( !(m_afMemory & bits_MEMORY_PROVOKED) )
		{
			if ( IsOkToCombatSpeak() )
			{
				if ( pFollowBehavior->GetFollowTarget() == NULL )
					Speak( TLK_UNUSE );
				else
					Speak( TLK_STOP );
			}
			SetSpeechTarget( FindNearestFriend(true) );
		}
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:27,代码来源:npc_talker.cpp

示例2: ADDTOCALLSTACK

bool CChar::NPC_SetVendorPrice( CItem * pItem, int iPrice )
{
	ADDTOCALLSTACK("CChar::NPC_SetVendorPrice");
	// player vendors.
	// CLIMODE_PROMPT_VENDOR_PRICE
	// This does not check who is setting the price if if it is valid for them to do so.

	if ( ! NPC_IsVendor())
		return( false );

	if ( pItem == NULL ||
		pItem->GetTopLevelObj() != this ||
		pItem->GetParent() == this )
	{
		Speak( g_Cfg.GetDefaultMsg( DEFMSG_NPC_PET_INV_ONLY ) );
		return( false );
	}

	CItemVendable * pVendItem = dynamic_cast <CItemVendable *> (pItem);
	if ( pVendItem == NULL )
	{
		Speak( g_Cfg.GetDefaultMsg( DEFMSG_NPC_PET_CANTSELL ) );
		return( false );
	}

	if ( iPrice < 0 )	// just a test.
		return( true );

	TCHAR *pszMsg = Str_GetTemp();
	sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_VENDOR_SETPRICE_1), pVendItem->GetName(), iPrice);
	Speak(pszMsg);

	pVendItem->SetPlayerVendorPrice( iPrice );
	return( true );
}
开发者ID:GenerationOfWorlds,项目名称:Source,代码行数:35,代码来源:CCharNPCPet.cpp

示例3: ADDTOCALLSTACK

bool CChar::NPC_StablePetRetrieve( CChar * pCharPlayer )
{
	ADDTOCALLSTACK("CChar::NPC_StablePetRetrieve");
	// Get pets for this person from my inventory.
	// May want to put up a menu ???

	if ( !m_pNPC || m_pNPC->m_Brain != NPCBRAIN_STABLE )
		return false;

	int iCount = 0;
	CItem *pItemNext = NULL;
	for ( CItem *pItem = GetBank()->GetContentHead(); pItem != NULL; pItem = pItemNext )
	{
		pItemNext = pItem->GetNext();
		if ( pItem->IsType(IT_FIGURINE) && pItem->m_uidLink == pCharPlayer->GetUID() )
		{
			if ( !pCharPlayer->Use_Figurine(pItem) )
			{
				tchar *pszTemp = Str_GetTemp();
				sprintf(pszTemp, g_Cfg.GetDefaultMsg(DEFMSG_NPC_STABLEMASTER_CLAIM_FOLLOWER), pItem->GetName());
				Speak(pszTemp);
				return true;
			}

			pItem->Delete();
			iCount++;
		}
	}

	Speak(g_Cfg.GetDefaultMsg((iCount > 0) ? DEFMSG_NPC_STABLEMASTER_CLAIM : DEFMSG_NPC_STABLEMASTER_CLAIM_NOPETS));
	return true;
}
开发者ID:nefthon,项目名称:Source,代码行数:32,代码来源:CCharNPCAct_Vendor.cpp

示例4: KilledUnit

    void KilledUnit(Unit *victim)
    {
		if(urand(0,1))
			Speak(CHAT_TYPE_SAY,16145,"Cafard insignifiant !");
		else
			Speak(CHAT_TYPE_SAY,16146,"Banni, au néant !");
		if(victim->GetTypeId() == TYPEID_PLAYER)
			SetInstanceData(TYPE_TRY,1);
    }
开发者ID:AwkwardDev,项目名称:MangosFX,代码行数:9,代码来源:boss_jaraxxus.cpp

示例5: Speak

void CNPCSimpleTalker::OnStoppingFollow( CBaseEntity *pTarget )
{
	if ( !(m_afMemory & bits_MEMORY_PROVOKED) )
	{
		if ( IsOkToCombatSpeak() )
		{
			if ( pTarget == NULL )
				Speak( TLK_STOPFOLLOW );
			else
				Speak( TLK_STOP );
		}
		SetSpeechTarget( FindNearestFriend(true) );
	}
}
开发者ID:Denzeriko,项目名称:hl2-mod,代码行数:14,代码来源:npc_talker.cpp

示例6: JustDied

    void JustDied(Unit *victim)
    {
        if (pInstance)
		{
            SetInstanceData(TYPE_JARAXXUS, DONE);
			Speak(CHAT_TYPE_SAY,16147,"Un autre prendra ma place. Votre monde est condamné.");
			if (Creature* Ann = ((Creature*)Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANNOUNCER) : 0)))
				((npc_toc10_announcerAI*)Ann->AI())->StartEvent(NULL,EVENT_TYPE_JARAXXUS_OUTRO);
		}
		switch(m_difficulty)
		{
			case RAID_DIFFICULTY_10MAN_NORMAL:
				GiveEmblemsToGroup(CONQUETE,2);
				break;
			case RAID_DIFFICULTY_25MAN_NORMAL:
				GiveEmblemsToGroup(TRIOMPHE,2);
				break;
			case RAID_DIFFICULTY_10MAN_HEROIC:
				GiveEmblemsToGroup(TRIOMPHE,3);
				break;
			case RAID_DIFFICULTY_25MAN_HEROIC:
				GiveEmblemsToGroup(TRIOMPHE,3);
				break;
		}
		me->ForcedDespawn(TEN_MINS*1000);
    }
开发者ID:AwkwardDev,项目名称:MangosFX,代码行数:26,代码来源:boss_jaraxxus.cpp

示例7: UpdateAI

    void UpdateAI(const uint32 diff)
    {
        if (!CanDoSomething())
            return;

		if(incinerate_Timer <= diff)
		{
			Yell(16149,"Que brûle la chair !");
			DoCastRandom(SPELL_INCINERATE_FLESH);
			incinerate_Timer = 20000;
		}
		else
			incinerate_Timer -= diff;

		if(portal_Timer <= diff)
		{
			Speak(CHAT_TYPE_SAY,16150,"Viens, ma soeur, ton maître t'appelle.");
			CallCreature(34825,TEN_MINS,NEAR_15M,AGGRESSIVE_MAIN);
			portal_Timer = 120000;
		}
		else
			portal_Timer -= diff;
		UpdateEvent(diff);

        DoMeleeAttackIfReady();
    }
开发者ID:AwkwardDev,项目名称:MangosFX,代码行数:26,代码来源:boss_jaraxxus.cpp

示例8: FindNearestFriend

//=========================================================
// IdleHello
// Try to greet player first time he's seen
//=========================================================
int CAI_PlayerAlly::FIdleHello( void )
{
	if (!IsOkToSpeak())
		return false;

	// if this is first time scientist has seen player, greet him
	if (!GetExpresser()->SpokeConcept(TLK_HELLO))
	{
		// get a player
		CBaseEntity *pPlayer = FindNearestFriend(true);

		if (pPlayer)
		{
			if (FInViewCone(pPlayer) && FVisible(pPlayer))
			{
				SetSpeechTarget( pPlayer );

				Speak( TLK_HELLO );
				
				return true;
			}
		}
	}
	return false;
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:29,代码来源:npc_talker.cpp

示例9: Speak

//=========================================================
// IdleRespond
// Respond to a previous question
//=========================================================
void CAI_PlayerAlly::IdleRespond( void )
{
	//int pitch = GetVoicePitch();
	
	// play response
	Speak( TLK_ANSWER );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:11,代码来源:npc_talker.cpp

示例10: ADDTOCALLSTACK

void CChar::NPC_OnHirePayMore(CItem *pGold, bool bHire)
{
	ADDTOCALLSTACK("CChar::NPC_OnHirePayMore");
	// We have been handed money.
	// similar to PC_STATUS

	CCharBase *pCharDef = Char_GetDef();
	CItemContainer *pBank = GetContainerCreate(LAYER_BANKBOX);
	if ( !pCharDef->m_iHireDayWage || !pBank )
		return;

	if ( pGold )
	{
		if ( bHire )
			pBank->m_itEqBankBox.m_Check_Amount = 0;	// clear previous balance

		pBank->m_itEqBankBox.m_Check_Amount += pGold->GetAmount();
		Sound(pGold->GetDropSound(NULL));
		pGold->Delete();
	}

	TCHAR *pszMsg = Str_GetTemp();
	sprintf(pszMsg, g_Cfg.GetDefaultMsg(DEFMSG_NPC_PET_HIRE_TIME), pBank->m_itEqBankBox.m_Check_Amount / pCharDef->m_iHireDayWage);
	Speak(pszMsg);
}
开发者ID:shiryux,项目名称:Source,代码行数:25,代码来源:CCharNPCPet.cpp

示例11: Speak

void CMenuMarcher::Think()
{
	BaseClass::Think();

	Speak();

	Vector vecNewOrigin = GetGlobalOrigin() + Vector(0, 5, 0) * (float)GameServer()->GetFrameTime();

	if (vecNewOrigin.y > 80)
		vecNewOrigin.y -= 160;

	vecNewOrigin.z = vecNewOrigin.z + GetGlobalVelocity().z * (float)GameServer()->GetFrameTime();

	float flNewHoverHeight = FindHoverHeight(vecNewOrigin) + 2;

	if (vecNewOrigin.z > flNewHoverHeight)
	{
		SetGlobalVelocity(Vector(0, 0, GetGlobalVelocity().z - 5 * (float)GameServer()->GetFrameTime()));
	}
	else
	{
		vecNewOrigin.z = flNewHoverHeight;
		SetGlobalVelocity(Vector(0, 0, Approach(0, GetGlobalVelocity().z, 1 * (float)GameServer()->GetFrameTime())));
	}

	SetGlobalOrigin(vecNewOrigin);
}
开发者ID:BSVino,项目名称:Digitanks,代码行数:27,代码来源:menumarcher.cpp

示例12: nsString

already_AddRefed<nsSpeechTask>
nsSynthVoiceRegistry::SpeakUtterance(SpeechSynthesisUtterance& aUtterance,
                                     const nsAString& aDocLang)
{
  nsString lang = nsString(aUtterance.mLang.IsEmpty() ? aDocLang : aUtterance.mLang);
  nsAutoString uri;

  if (aUtterance.mVoice) {
    aUtterance.mVoice->GetVoiceURI(uri);
  }

  nsRefPtr<nsSpeechTask> task;
  if (XRE_GetProcessType() == GeckoProcessType_Content) {
    task = new SpeechTaskChild(&aUtterance);
    SpeechSynthesisRequestChild* actor =
      new SpeechSynthesisRequestChild(static_cast<SpeechTaskChild*>(task.get()));
    mSpeechSynthChild->SendPSpeechSynthesisRequestConstructor(actor,
                                                              aUtterance.mText,
                                                              lang,
                                                              uri,
                                                              aUtterance.Volume(),
                                                              aUtterance.Rate(),
                                                              aUtterance.Pitch());
  } else {
    task = new nsSpeechTask(&aUtterance);
    Speak(aUtterance.mText, lang, uri,
          aUtterance.Rate(), aUtterance.Pitch(), task);
  }

  return task.forget();
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:31,代码来源:nsSynthVoiceRegistry.cpp

示例13: ADDTOCALLSTACK

void CItemCommCrystal::OnHear(LPCTSTR pszCmd, CChar *pSrc)
{
	ADDTOCALLSTACK("CItemCommCrystal::OnHear");
	// IT_COMM_CRYSTAL
	// STATF_COMM_CRYSTAL = if i am on a person.
	TALKMODE_TYPE mode = TALKMODE_SAY;
	for ( size_t i = 0; i < m_Speech.GetCount(); i++ )
	{
		CResourceLink *pLink = m_Speech[i];
		ASSERT(pLink);
		CResourceLock s;
		if ( !pLink->ResourceLock(s) )
			continue;
		TRIGRET_TYPE iRet = OnHearTrigger(s, pszCmd, pSrc, mode);
		if ( iRet == TRIGRET_ENDIF || iRet == TRIGRET_RET_FALSE )
			continue;
		break;
	}

	// That's prevent @ -1 crash speech :P
	if ( *pszCmd == '@' )
		return;

	if ( m_uidLink.IsValidUID() )
	{
		// I am linked to something ?
		// Transfer the sound.
		CItem *pItem = m_uidLink.ItemFind();
		if ( pItem && pItem->IsType(IT_COMM_CRYSTAL) )
			pItem->Speak(pszCmd);
	}
	else if ( m_Speech.GetCount() <= 0 )
		Speak(pszCmd);
}
开发者ID:DarkLotus,项目名称:Source,代码行数:34,代码来源:CItemSpawn.cpp

示例14: Speak

void CNPC_HL1Barney::DeclineFollowing( void )
{
	if ( CanSpeakAfterMyself() )
	{
		Speak( BA_POK );
	}
}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:7,代码来源:hl1_npc_barney.cpp

示例15: SentenceStop

//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void CNPC_Monk::DeathSound( const CTakeDamageInfo &info )
{
	// Sentences don't play on dead NPCs
	SentenceStop();

	Speak( TLK_DEATH );
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:9,代码来源:npc_monk.cpp


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