本文整理汇总了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 );
}
示例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 );
}
示例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;
}
示例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;
}
示例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();
}
示例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( );
}
示例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();
}
示例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;
}
示例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 );
}
示例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 );
}
示例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;
}
示例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;
}
示例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 );
}
示例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 );
}
示例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);
}