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


C++ ResetSequence函数代码示例

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


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

示例1: atoi

//-----------------------------------------------------------------------------
// Purpose: Input that sets the sequence of the cycler
//-----------------------------------------------------------------------------
void CCycler::InputSetSequence( inputdata_t &inputdata )
{
	if (m_animate)
	{
		// Legacy support: Try it as a number, and support '0'
		const char *sChar = inputdata.value.String();
		int iSeqNum = atoi( sChar );
		if ( !iSeqNum && sChar[0] != '0' )
		{
			// Treat it as a sequence name
			ResetSequence( LookupSequence( sChar ) );
		}
		else
		{
			ResetSequence( iSeqNum );
		}

		if (GetPlaybackRate() == 0.0)
		{
			ResetSequence( 0 );
		}

		m_flCycle = 0;
	}
}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:28,代码来源:h_cycler.cpp

示例2: ToBasePlayer

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPropVehicleDriveable::Use( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	CBasePlayer *pPlayer = ToBasePlayer( pActivator );
	if ( !pPlayer )
		return;

	ResetUseKey( pPlayer );

	// Find out which hitbox the player's eyepoint is within
	int iEntryAnim = m_pServerVehicle->GetEntryAnimForPoint( pPlayer->EyePosition() );

	// Are we in an entrypoint zone? 
	if ( iEntryAnim != ACTIVITY_NOT_AVAILABLE )
	{
		// Check to see if this vehicle can be controlled or if it's locked
		if ( CanControlVehicle() && CanEnterVehicle(pPlayer) )
		{
			pPlayer->GetInVehicle( GetServerVehicle(), VEHICLE_DRIVER);

			// Setup the "enter" vehicle sequence and skip the animation if it isn't present.
			m_flCycle = 0;
			m_flAnimTime = gpGlobals->curtime;
			ResetSequence( iEntryAnim );
			ResetClientsideFrame();
			m_bEnterAnimOn = true;
		}
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:31,代码来源:vehicle_base.cpp

示例3: Precache

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CNewWallHealth::Spawn(void)
{
	Precache( );

	SetMoveType( MOVETYPE_NONE );
	SetSolid( SOLID_VPHYSICS );
	CreateVPhysics();

	SetModel( HEALTH_CHARGER_MODEL_NAME );
	AddEffects( EF_NOSHADOW );

	ResetSequence( LookupSequence( "idle" ) );

	m_iJuice = sk_healthcharger.GetInt();

	m_nState = 0;	
	
	m_iReactivate = 0;
	m_iCaps	= FCAP_CONTINUOUS_USE;

	CreateVPhysics();

	m_flJuice = m_iJuice;
	SetCycle( 1.0f - ( m_flJuice /  sk_healthcharger.GetFloat() ) );
}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:28,代码来源:item_healthkit.cpp

示例4: GetModelName

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPointCommentaryNode::Spawn( void )
{
	// No model specified?
	char *szModel = (char *)STRING( GetModelName() );
	if (!szModel || !*szModel)
	{
		szModel = "models/extras/info_speech.mdl";
		SetModelName( AllocPooledString(szModel) );
	}

	Precache();
	SetModel( szModel );
	UTIL_SetSize( this, -Vector(16,16,16), Vector(16,16,16) );
	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_CUSTOMRAYTEST | FSOLID_CUSTOMBOXTEST );
	AddEffects( EF_NOSHADOW );

	// Setup for animation
	ResetSequence( LookupSequence("idle") );
	SetThink( &CPointCommentaryNode::SpinThink );
	SetNextThink( gpGlobals->curtime + 0.1f ); 

	m_iNodeNumber = 0;
	m_iNodeNumberMax = 0;

	SetDisabled( m_bDisabled );
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:30,代码来源:commentarysystem.cpp

示例5: MDLCACHE_CRITICAL_SECTION

void C_DHL_Player::ClientDeath( void )
{
	//This function should only be called for the local player, but just in case...
	if ( !IsLocalPlayer() )
		return;

	//Fix ragdolls getting borked because of the stunt sequence
	if ( m_bProne )
	{
		MDLCACHE_CRITICAL_SECTION();
		ResetSequence( SelectWeightedSequence( ACT_DHL_PRONE_GENERIC ) );
	}

	//Gotta go to first person for the ragdoll death cam
	if ( input->CAM_IsThirdPerson() )
	{
		engine->ClientCmd( "firstperson \n");
		m_bWantsThirdPerson = true;
	}

	if ( GetNightvisionEnabled() )
	{
		EnableNightvision( false );
		m_bWantsNV = true;
	}
	vieweffects->ClearAllFades(); //No screenfades after death
}
开发者ID:dreckard,项目名称:dhl2,代码行数:27,代码来源:c_dhl_player.cpp

示例6: SetNextThink

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPropAPC::Think( void )
{
	BaseClass::Think();

	SetNextThink( gpGlobals->curtime );

	if ( !m_bInitialHandbrake )	// after initial timer expires, set the handbrake
	{
		m_bInitialHandbrake = true;
		m_VehiclePhysics.SetHandbrake( true );
		m_VehiclePhysics.Think();
	}

	StudioFrameAdvance();

	if ( IsSequenceFinished() )
	{
		int iSequence = SelectWeightedSequence( ACT_IDLE );
		if ( iSequence > ACTIVITY_NOT_AVAILABLE )
		{
			SetCycle( 0 );
			m_flAnimTime = gpGlobals->curtime;
			ResetSequence( iSequence );
			ResetClientsideFrame();
		}
	}

	if (m_debugOverlays & OVERLAY_NPC_KILL_BIT)
	{
		CTakeDamageInfo info( this, this, m_iHealth, DMG_BLAST );
		info.SetDamagePosition( WorldSpaceCenter() );
		info.SetDamageForce( Vector( 0, 0, 1 ) );
		TakeDamage( info );
	}
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:38,代码来源:vehicle_apc.cpp

示例7: Precache

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void Dota_Resupply::Spawn( void )
{
	Precache();

	BaseClass::Spawn();

	SetModel( STRING( GetModelName() ) );
	SetMoveType( MOVETYPE_NONE );
	SetSolid( SOLID_VPHYSICS );
	CreateVPhysics();

	ResetSequence( LookupSequence( "Idle" ) );
	SetBodygroup( 1, true );

	m_flCloseTime = gpGlobals->curtime;
	m_flAnimTime = gpGlobals->curtime;
	m_flPlaybackRate = 0.0;
	SetCycle( 0 );

	m_takedamage = DAMAGE_EVENTS_ONLY;

	// Issue #28: JMS - 2013-10-12 - ammobox needs to fire a new modevent letting all clients know that one is spawned
	IGameEvent *pEvent = gameeventmanager->CreateEvent( "ammobox_spawn" );
	if ( pEvent )
	{
		pEvent->SetInt( "entindex", entindex() );
		gameeventmanager->FireEvent( pEvent );
	}
}
开发者ID:schroe2a,项目名称:DotaSource2,代码行数:32,代码来源:dota_resupply.cpp

示例8: SetThink

//-----------------------------------------------------------------------------
// Purpose: Start playing personality VO list
//-----------------------------------------------------------------------------
void CPropGladosCore::TalkingThink( void )
{
	if ( m_speechEvents.Count() <= 0 || !m_speechEvents.IsValidIndex( m_iSpeechIter ) )
	{
		SetThink ( NULL );
		SetNextThink( gpGlobals->curtime );
		return;
	}

	// Loop the 'look around' animation after the first line.
	int iCurSequence = GetSequence();
	int iLookSequence = LookupSequence( STRING(m_iszLookAnimationName) );
	if ( iCurSequence != iLookSequence && m_iSpeechIter > 0 )
	{
		ResetSequence( iLookSequence );
	}

	int iPrevIter = m_iSpeechIter-1;
	if ( iPrevIter < 0 )
		iPrevIter = 0;

	StopSound( m_speechEvents[iPrevIter].ToCStr() );

	float flCurDuration = GetSoundDuration( m_speechEvents[m_iSpeechIter].ToCStr(), GLADOS_CORE_MODEL_NAME );

	EmitSound( m_speechEvents[m_iSpeechIter].ToCStr() );
	SetNextThink( gpGlobals->curtime + m_flBetweenVOPadding + flCurDuration );

	// wrap if we hit the end of the list
	m_iSpeechIter = (m_iSpeechIter+1)%m_speechEvents.Count();
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:34,代码来源:prop_glados_core.cpp

示例9: Precache

void CNewRecharge::Spawn()
{
	Precache( );

	SetMoveType( MOVETYPE_NONE );
	SetSolid( SOLID_VPHYSICS );
	CreateVPhysics();

	SetModel( HEALTH_CHARGER_MODEL_NAME );
	AddEffects( EF_NOSHADOW );

	ResetSequence( LookupSequence( "idle" ) );

	SetInitialCharge();

	UpdateJuice( MaxJuice() );

	m_nState = 0;		
	m_iCaps	= FCAP_CONTINUOUS_USE;

	CreateVPhysics();

	m_flJuice = m_iJuice;

	m_iReactivate = 0;

	SetCycle( 1.0f - ( m_flJuice / MaxJuice() ) );
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:28,代码来源:func_recharge.cpp

示例10: Action_ResetTrDos

void Action_ResetTrDos(void)
{
	isPaused = false;
	ResetSequence();
	dev_mman.OnOutputByte(0x7FFD, 0x10);
	dev_trdos.Enable();
}
开发者ID:mkoloberdin,项目名称:zemu,代码行数:7,代码来源:zemu.cpp

示例11: UTIL_Remove

void CNPC_RocketTurret::FireRocket ( void )
{
	UTIL_Remove( m_hCurRocket );

	CRocket_Turret_Projectile *pRocket = (CRocket_Turret_Projectile *) CBaseEntity::Create( "rocket_turret_projectile", EyePosition(), m_vecCurrentAngles, this );

	if ( !pRocket )
		return;

	m_hCurRocket = pRocket;

	Vector vForward;
	AngleVectors( m_vecCurrentAngles, &vForward, NULL, NULL );

	m_flTimeLastFired = gpGlobals->curtime;

	EmitSound ( ROCKET_PROJECTILE_FIRE_SOUND );
	ResetSequence(LookupSequence("fire"));

	pRocket->SetThink( NULL );
	pRocket->SetMoveType( MOVETYPE_FLY );

	pRocket->CreateSmokeTrail();

	pRocket->SetModel( ROCKET_TURRET_PROJECTILE_NAME );
	UTIL_SetSize( pRocket, vec3_origin, vec3_origin );

	pRocket->SetAbsVelocity( vForward * 550 );
	pRocket->SetLauncher ( this );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:30,代码来源:npc_rocket_turret.cpp

示例12: UpdateFacing

//-----------------------------------------------------------------------------
// Purpose: Charge up, prepare to fire and give player time to dodge
//-----------------------------------------------------------------------------
void CNPC_RocketTurret::LockingThink( void )
{
	//Allow descended classes a chance to do something before the think function
	if ( PreThink() )
		return;

	//Turn to face
	UpdateFacing();
	SetNextThink( gpGlobals->curtime + ROCKET_TURRET_THINK_RATE );

    if ( m_flTimeLocking == 0.0f )
	{
		// Play lockon sound
		EmitSound ( ROCKET_TURRET_SOUND_LOCKING );
		EmitSound ( ROCKET_TURRET_SOUND_LOCKING, gpGlobals->curtime + ROCKET_TURRET_QUARTER_LOCKON_TIME );
		EmitSound ( ROCKET_TURRET_SOUND_LOCKED, gpGlobals->curtime + ROCKET_TURRET_HALF_LOCKON_TIME );

		ResetSequence(LookupSequence("load"));

		// Change lockon sprite
		UpdateSkin( ROCKET_SKIN_LOCKING );
	}

	m_flTimeLocking += ROCKET_TURRET_THINK_RATE;

	if ( m_flTimeLocking > ROCKET_TURRET_LOCKON_TIME )
	{
		// Set Locked sprite to 'rocket out' color
		UpdateSkin( ROCKET_SKIN_LOCKED );

		FireRocket();
		SetThink ( &CNPC_RocketTurret::FiringThink );
		m_flTimeLocking = 0.0f;
	}
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:38,代码来源:npc_rocket_turret.cpp

示例13: UTIL_PlayerByIndex

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPropVehicleViewController::InputForcePlayerIn( inputdata_t &inputdata )
{
	CBasePlayer *pPlayer = UTIL_PlayerByIndex(1);
	if ( !pPlayer )
		return;

	ResetUseKey( pPlayer );

	// Get the entry animation from the input
	int iEntryAnim = ACTIVITY_NOT_AVAILABLE;
	if ( inputdata.value.StringID() != NULL_STRING )
	{
		iEntryAnim = LookupSequence( inputdata.value.String() );
		if ( iEntryAnim == ACTIVITY_NOT_AVAILABLE )
		{
			Warning("vehicle_viewcontroller %s could not find specified entry animation %s\n", STRING(GetEntityName()), inputdata.value.String() );
			return;
		}
	}

	// Make sure we successfully got in the vehicle
	if ( pPlayer->GetInVehicle( GetServerVehicle(), VEHICLE_ROLE_DRIVER ) == false )
	{
		// The player was unable to enter the vehicle and the output has failed
		Assert( 0 );
		return;
	}

	// Setup the "enter" vehicle sequence
	SetCycle( 0 );
	m_flAnimTime = gpGlobals->curtime;
	ResetSequence( iEntryAnim );
	ResetClientsideFrame();
	m_bEnterAnimOn = true;
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:38,代码来源:vehicle_viewcontroller.cpp

示例14: SelectWeightedSequence

void CRagdollProp::InitRagdollAnimation()
{
	m_flAnimTime = gpGlobals->curtime;
	m_flPlaybackRate = 0.0;
	m_flCycle = 0;
	
	// put into ACT_DIERAGDOLL if it exists, otherwise use sequence 0
	int nSequence = SelectWeightedSequence( ACT_DIERAGDOLL );
	if ( nSequence < 0 )
	{
		ResetSequence( 0 );
	}
	else
	{
		ResetSequence( nSequence );
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:17,代码来源:physics_prop_ragdoll.cpp

示例15: SetModel

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFProjectile_SentryRocket::Spawn()
{
	BaseClass::Spawn();

	SetModel( SENTRY_ROCKET_MODEL );

	ResetSequence( LookupSequence("idle") );
}
开发者ID:MrBoomer568,项目名称:TF2Classic,代码行数:11,代码来源:tf_obj_sentrygun.cpp


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