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


C++ SetUse函数代码示例

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


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

示例1: SetUse

void CFriend::Killed( entvars_t *pevAttacker, int iGib )
{
//used a event

	SetUse( NULL );	
	CTalkMonster::Killed( pevAttacker, iGib );
}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:7,代码来源:hgrunt_f.cpp

示例2: Precache

void CLeech::Spawn( void )
{
	Precache();
	SET_MODEL(ENT(pev), "models/leech.mdl");
	// Just for fun
	//	SET_MODEL(ENT(pev), "models/icky.mdl");
	
//	UTIL_SetSize( pev, g_vecZero, g_vecZero );
	UTIL_SetSize( pev, Vector(-1,-1,0), Vector(1,1,2));
	// Don't push the minz down too much or the water check will fail because this entity is really point-sized
	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_FLY;
	SetBits(pev->flags, FL_SWIM);
	pev->health			= gSkillData.leechHealth;

	m_flFieldOfView		= -0.5;	// 180 degree FOV
	m_flDistLook		= 750;
	MonsterInit();
	SetThink( &CLeech::SwimThink );
	SetUse( NULL );
	SetTouch( NULL );
	pev->view_ofs = g_vecZero;

	m_flTurning = 0;
	m_fPathBlocked = FALSE;
	SetActivity( ACT_SWIM );
	SetState( MONSTERSTATE_IDLE );
	m_stateTime = gpGlobals->time + RANDOM_FLOAT( 1, 5 );
}
开发者ID:HoLyCoWzOrZ,项目名称:sing-engine,代码行数:29,代码来源:leech.cpp

示例3: SetBits

bool AvHHive::StartSpawningForTeam(AvHTeamNumber inTeam, bool inForce)
{
	bool theSuccess = false;

	if(this->SetSolid(inForce))
	{
		this->pev->team = inTeam;
		this->pev->takedamage = DAMAGE_YES;

		this->pev->rendermode = kRenderNormal;
		this->pev->renderamt = 0;
		
		SetBits(pev->flags, FL_MONSTER);
		SetUpgradeMask(&this->pev->iuser4, MASK_BUILDABLE);
		
		this->mSpawning = true;
		this->pev->health = kBaseHealthPercentage*this->mBaseHealth;

		// Looping, growing animation
		this->pev->sequence	= 0;
		this->pev->frame = 0;
		ResetSequenceInfo();

		this->pev->nextthink = gpGlobals->time + kHiveAliveThinkInterval;
		SetThink(&AvHHive::HiveAliveThink);
		SetUse(&AvHHive::TeleportUse);

		theSuccess = true;
	}

	return theSuccess;
}
开发者ID:Arkshine,项目名称:NS,代码行数:32,代码来源:AvHHive.cpp

示例4: SET_MODEL

// create ourselves a particle emitter
void CParticleEmitter::Spawn( void )
{
	pev->solid = SOLID_NOT;
	pev->movetype = MOVETYPE_NONE;
	SET_MODEL (ENT(pev), STRING(pev->model));
	pev->effects |= EF_NODRAW;
	
	UTIL_SetOrigin( pev, pev->origin ); 		
	UTIL_SetSize( pev, pev->absmin, pev->absmax );

    SetUse ( &CParticleEmitter::Use );

	if (pev->spawnflags & SF_START_ON)
	{
		ALERT (at_console, "CParticleEmitter Spawn in <ON> Mode\nNextthink in 0.5 Seconds\n");

		bIsOn = true;
		iID = ++iParticleIDCount;

		SetThink( &CParticleEmitter::TurnOn );
		pev->nextthink = gpGlobals->time + 0.5;
	}
	else
	{
		bIsOn = false;
	}

	IsTriggered(NULL);
	iID = ++iParticleIDCount;
	flTimeTurnedOn = 0.0;
}
开发者ID:Fograin,项目名称:hl-subsmod-ex,代码行数:32,代码来源:particle_emitter.cpp

示例5: Precache

void CBaseTurret::Spawn()
{ 
	Precache( );
	pev->nextthink		= gpGlobals->time + 1;
	pev->movetype		= MOVETYPE_FLY;
	pev->sequence		= 0;
	pev->frame			= 0;
	pev->solid			= SOLID_SLIDEBOX;
	pev->takedamage		= DAMAGE_AIM;

	SetBits (pev->flags, FL_MONSTER);
	SetUse(&CBaseTurret::TurretUse );

	if (( pev->spawnflags & SF_MONSTER_TURRET_AUTOACTIVATE ) 
		 && !( pev->spawnflags & SF_MONSTER_TURRET_STARTINACTIVE ))
	{
		m_iAutoStart = TRUE;
	}

	ResetSequenceInfo( );
	SetBoneController( 0, 0 );
	SetBoneController( 1, 0 );
	m_flFieldOfView = VIEW_FIELD_FULL;
	// m_flSightRange = this->GetRange();
}
开发者ID:Arkshine,项目名称:NS,代码行数:25,代码来源:turret.cpp

示例6: SetThink

//-----------------------------------------------------------------------------
// Purpose: Called when spawning, after keyvalues have been handled.
//-----------------------------------------------------------------------------
void CEnvSpark::Spawn(void)
{
	SetThink( NULL );
	SetUse( NULL );

	if ( FBitSet(m_spawnflags, SF_SPARK_START_ON ) )
	{
		SetThink( &CEnvSpark::SparkThink );	// start sparking
	}

	SetNextThink( gpGlobals->curtime + 0.1 + random->RandomFloat( 0, 1.5 ) );

	// Negative delays are not allowed
	if ( m_flDelay < 0 )
	{
		m_flDelay = 0;
	}

#ifdef HL1_DLL
	// Don't allow 0 delays in HL1 Port. Enforce a default
	if( m_flDelay == 0 )
	{
		m_flDelay = 1.0f;
	}
#endif//HL1_DLL
	
	Precache( );
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:31,代码来源:EnvSpark.cpp

示例7: Precache

void CSatchelCharge::Spawn( void )
{
	Precache( );
	// motor
	SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE );
	SetSolid( SOLID_BBOX ); 
	SetCollisionGroup( COLLISION_GROUP_PROJECTILE );
	SetModel( "models/Weapons/w_slam.mdl" );

	UTIL_SetSize(this, Vector( -6, -6, -2), Vector(6, 6, 2));

	SetTouch( SatchelTouch );
	SetUse( SatchelUse );
	SetThink( SatchelThink );
	SetNextThink( gpGlobals->curtime + 0.1f );

	m_flDamage		= sk_plr_dmg_satchel.GetFloat();
	m_DmgRadius		= sk_satchel_radius.GetFloat();
	m_takedamage	= DAMAGE_YES;
	m_iHealth		= 1;

	SetGravity( UTIL_ScaleForGravity( 560 ) );	// slightly lower gravity
	SetFriction( 1.0 );
	SetSequence( 1 );

	m_bIsAttached			= false;
	m_bInAir				= true;
	m_flSlideVolume			= -1.0;
	m_flNextBounceSoundTime	= 0;

	m_vLastPosition	= vec3_origin;

	InitSlideSound();
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:34,代码来源:grenade_satchel.cpp

示例8: Precache

void CGrenadeMP5::Spawn( void )
{
	Precache( );
	SetSolid( SOLID_BBOX );
	SetMoveType( MOVETYPE_FLY );
	AddFlag( FL_GRENADE );

	SetModel( "models/grenade.mdl" );
	//UTIL_SetSize(this, Vector(-3, -3, -3), Vector(3, 3, 3));
	UTIL_SetSize(this, Vector(0, 0, 0), Vector(0, 0, 0));

	SetUse( &CBaseGrenade::DetonateUse );
	SetTouch( &CGrenadeMP5::GrenadeMP5Touch );
	SetNextThink( gpGlobals->curtime + 0.1f );

	m_flDamage		= sk_plr_dmg_mp5_grenade.GetFloat();
	m_DmgRadius		= sk_mp5_grenade_radius.GetFloat();
	m_takedamage	= DAMAGE_YES;
	m_bIsLive		= true;
	m_iHealth		= 1;

	SetGravity( UTIL_ScaleForGravity( 400 ) );	// use a lower gravity for grenades to make them easier to see
	SetFriction( 0.8 );

	SetSequence( 0 );

	m_fSpawnTime	= gpGlobals->curtime;
}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:28,代码来源:hl1_grenade_mp5.cpp

示例9: SetThink

void CApache::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	SetThink(&CApache:: HuntThink );
	SetTouch(&CApache:: FlyTouch );
	SetNextThink( 0.1 );
	SetUse( NULL );
}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:7,代码来源:npc_apache.cpp

示例10: Spawn

//=========================================================
// Spawn
//=========================================================
void CBarney :: Spawn()
{
	Precache( );

	if (pev->model)
		SET_MODEL(ENT(pev), STRING(pev->model)); //LRC
	else
		SET_MODEL(ENT(pev), "models/barney.mdl");
	UTIL_SetSize(pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX);

	pev->solid			= SOLID_SLIDEBOX;
	pev->movetype		= MOVETYPE_STEP;
	m_bloodColor		= BLOOD_COLOR_RED;
	if (pev->health == 0) //LRC
		pev->health	= gSkillData.barneyHealth;
	pev->view_ofs		= Vector ( 0, 0, 50 );// position of the eyes relative to monster's origin.
	m_flFieldOfView		= VIEW_FIELD_WIDE; // NOTE: we need a wide field of view so npc will notice player and say hello
	m_MonsterState		= MONSTERSTATE_NONE;

	m_iBaseBody = pev->body; //LRC
	pev->body			= m_iBaseBody + BARNEY_BODY_GUNHOLSTERED; // gun in holster
	m_fGunDrawn			= FALSE;

	m_afCapability		= bits_CAP_HEAR | bits_CAP_TURN_HEAD | bits_CAP_DOORS_GROUP;

	MonsterInit();
	SetUse( &CTalkMonster::FollowerUse );
}
开发者ID:FWGS,项目名称:XashXT,代码行数:31,代码来源:barney.cpp

示例11: UTIL_FindEntityByTargetname

void CNihilanth::StartupThink( void )
{
	m_irritation = 0;
	m_flAdj = 512;

	CBaseEntity *pEntity;

	pEntity = UTIL_FindEntityByTargetname( NULL, "n_min");
	if (pEntity)
		m_flMinZ = pEntity->pev->origin.z;
	else
		m_flMinZ = -4096;

	pEntity = UTIL_FindEntityByTargetname( NULL, "n_max");
	if (pEntity)
		m_flMaxZ = pEntity->pev->origin.z;
	else
		m_flMaxZ = 4096;

	m_hRecharger = this;
	for (int i = 0; i < N_SPHERES; i++)
	{
		EmitSphere( );
	}
	m_hRecharger = NULL;

	SetThink( &CNihilanth::HuntThink);
	SetUse( &CNihilanth::CommandUse );
	pev->nextthink = gpGlobals->time + 0.1;
}
开发者ID:6779660,项目名称:halflife,代码行数:30,代码来源:nihilanth.cpp

示例12: Spawn

//=========================================================
// Spawn
//=========================================================
void CIchthyosaur :: Spawn()
{
	Precache( );

	SET_MODEL(ENT(pev), "models/icky.mdl");
	UTIL_SetSize( pev, Vector( -32, -32, -32 ), Vector( 32, 32, 32 ) );

	pev->solid			= SOLID_BBOX;
	pev->movetype		= MOVETYPE_FLY;
	m_bloodColor		= BLOOD_COLOR_GREEN;
	pev->health			= gSkillData.ichthyosaurHealth;
	pev->view_ofs		= Vector ( 0, 0, 16 );
	m_flFieldOfView		= VIEW_FIELD_WIDE;
	m_MonsterState		= MONSTERSTATE_NONE;
	SetBits(pev->flags, FL_SWIM);
	SetFlyingSpeed( ICHTHYOSAUR_SPEED );
	SetFlyingMomentum( 2.5 );	// Set momentum constant

	m_afCapability		= bits_CAP_RANGE_ATTACK1 | bits_CAP_SWIM;

	MonsterInit();

	SetTouch( BiteTouch );
	SetUse( CombatUse );

	m_idealDist = 384;
	m_flMinSpeed = 80;
	m_flMaxSpeed = 300;
	m_flMaxDist = 384;

	Vector Forward;
	UTIL_MakeVectorsPrivate(pev->angles, Forward, 0, 0);
	pev->velocity = m_flightSpeed * Forward.Normalize();
	m_SaveVelocity = pev->velocity;
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:38,代码来源:ichthyosaur.cpp

示例13: SetThink

void CApache::StartupUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	SetThink( HuntThink );
	SetTouch( FlyTouch );
	pev->nextthink = gpGlobals->time + 0.1;
	SetUse( NULL );
}
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:7,代码来源:apache.cpp

示例14: Precache

void CGrenadeSpit::Spawn( void )
{
	Precache( );
	SetSolid( SOLID_BBOX );
	SetMoveType( MOVETYPE_FLYGRAVITY );

	// FIXME, if these is a sprite, then we need a base class derived from CSprite rather than
	// CBaseAnimating.  pev->scale becomes m_flSpriteScale in that case.
	SetModel( "models/spitball_large.mdl" );
	UTIL_SetSize(this, Vector(0, 0, 0), Vector(0, 0, 0));

	m_nRenderMode		= kRenderTransAdd;
	SetRenderColor( 255, 255, 255, 255 );
	m_nRenderFX		= kRenderFxNone;

	SetThink( SpitThink );
	SetUse( DetonateUse );
	SetTouch( GrenadeSpitTouch );
	SetNextThink( gpGlobals->curtime + 0.1f );

	m_flDamage		= sk_dmg_spit_grenade.GetFloat();
	m_DmgRadius		= sk_spit_grenade_radius.GetFloat();
	m_takedamage	= DAMAGE_YES;
	m_iHealth		= 1;

	SetGravity( UTIL_ScaleForGravity( SPIT_GRAVITY ) );
	SetFriction( 0.8 );
	SetSequence( 1 );

	SetCollisionGroup( HL2COLLISION_GROUP_SPIT );
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:31,代码来源:grenade_spit.cpp

示例15: MAKE_STRING

void AvHBaseBuildable::Materialize()
{
	this->pev->solid = SOLID_BBOX;

	this->pev->movetype = this->GetMoveType();
	
	this->pev->classname = MAKE_STRING(this->mClassName);
	
	this->pev->takedamage = DAMAGE_YES;
	SetBits(this->pev->flags, FL_MONSTER);
	
	// Always buildable
	this->InternalInitializeBuildable();
	
	this->SetNormalizedBuildPercentage(0.0f);
	
	// NOTE: fuser2 is used for repairing structures

	Vector theMinSize, theMaxSize;
	//int theSequence = this->GetSequenceForBoundingBox();

	// Get height needed for model
	//this->ExtractBbox(theSequence, (float*)&theMinSize, (float*)&theMaxSize);
	//float theHeight = theMaxSize.z - theMinSize.z;

	AvHSHUGetSizeForTech(this->GetMessageID(), theMinSize, theMaxSize);

	UTIL_SetSize(pev, theMinSize, theMaxSize);

	this->PlayAnimationAtIndex(this->GetSpawnAnimation(), true);
		
	SetUse(&AvHBaseBuildable::ConstructUse);
}
开发者ID:Arkshine,项目名称:NS,代码行数:33,代码来源:AvHBaseBuildable.cpp


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