コード例 #1
0
ファイル: SecurityCamera.cpp プロジェクト: Arc0re/lithtech
void SecurityCamera::UpdateSounds(State eStatePrevious)
{
	if ((m_eState == eStateDetected) &&
		(eStatePrevious != eStateDetected))
	{
		PlayDetectedSound();
	}
	else if ((m_eState == eStatePausingAt1) ||
		(m_eState == eStatePausingAt2) ||
		(m_eState == eStateFocusing))
	{
		StopLoopSound();
	}
	else if ((eStatePrevious == eStateFocusing) ||
			 (eStatePrevious == eStatePausingAt1) ||
			 (eStatePrevious == eStatePausingAt2))
	{
		StartLoopSound();
	}

}
コード例 #2
0
void ThrowObject::Touch( Event *ev )
{
	Entity *other;
	
	if ( movetype != MOVETYPE_BOUNCE )
	{
		return;
	}
	
	other = ev->GetEntity( 1 );
	assert( other );
	
	if ( other->isSubclassOf( Teleporter ) )
	{
		return;
	}
	
	if ( other->entnum == owner )
	{
		return;
	}
	
	if ( throw_sound.length() )
	{
		StopLoopSound();
	}
	
	if ( other->takedamage && !hurt_target )
	{
		// other->Damage( this, G_GetEntity( owner ), size.length() * velocity.length() / 400, origin, velocity,
		//    level.impact_trace.plane.normal, 32, 0, MOD_THROWNOBJECT );
		
		other->Damage( this, G_GetEntity( owner ), damage, origin, velocity,
			level.impact_trace.plane.normal, 32, 0, MOD_THROWNOBJECT );
		hurt_target = true;
	}
	
	//Damage( this, this, max_health, origin, velocity, level.impact_trace.plane.normal, 32, 0, MOD_THROWNOBJECT );
	Damage( this, this, 0.0f, origin, velocity, level.impact_trace.plane.normal, 32, 0, MOD_THROWNOBJECT );
}
コード例 #3
0
ファイル: SecurityCamera.cpp プロジェクト: Arc0re/lithtech
void SecurityCamera::KillAllSounds()
{
	StopFocusingSound();
	StopLoopSound();
}