//-----------------------------------------------------------------------------
// Purpose: 
// Input  :
// Output : 
//-----------------------------------------------------------------------------
void CNPC_Headcrab::Spawn( void )
{
	Precache();

	SetRenderColor( 255, 255, 255, 255 );

	SetModel( "models/headcrab.mdl" );
	m_iHealth = sk_headcrab_health.GetFloat();

	SetHullType(HULL_TINY);
	SetHullSizeNormal();

	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_NOT_STANDABLE );
	SetMoveType( MOVETYPE_STEP );
	SetViewOffset( Vector(6, 0, 11) );		// Position of the eyes relative to NPC's origin.

	m_bloodColor		= BLOOD_COLOR_GREEN;
	m_flFieldOfView		= 0.5;
	m_NPCState			= NPC_STATE_NONE;
	m_nGibCount			= HEADCRAB_ALL_GIB_COUNT;
	
	CapabilitiesClear();
	CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_RANGE_ATTACK1 );

	NPCInit();
}
// ------------------------------------------------------------------------- //
// C_SmokeStack implementation.
// ------------------------------------------------------------------------- //
C_SmokeStack::C_SmokeStack()
{
	m_pParticleMgr = NULL;
	m_MaterialHandle[0] = INVALID_MATERIAL_HANDLE;
	m_iMaterialModel = -1;
	
	m_SpreadSpeed = 15;
	m_Speed = 30;
	m_StartSize = 10;
	m_EndSize = 15;
	m_Rate = 80;
	m_JetLength = 180;
	m_bEmit = true;

	m_flBaseSpread = 20;
	m_bInView = false;

	// Lighting is (base color) + (ambient / dist^2) + bump(directional / dist^2)
	// By default, we use bottom-up lighting for the directional.
	SetRenderColor( 0, 0, 0, 255 );

	m_AmbientLight.m_vPos.Init(0,0,-100);
	m_AmbientLight.m_vColor.Init( 40, 40, 40 );
	m_AmbientLight.m_flIntensity = 8000;

	m_DirLight.m_vColor.Init( 255, 128, 0 );
	
	m_vWind.Init();

	m_flTwist = 0;
}
void SpriteBatch_GL3::Begin()
{
	m_processingRender  = true;
	m_currentIndex      = 0;
	m_currentVert       = 0;
	m_currentTextureID	= 0;
	m_numFlushes		= 0;

	//RenderTexture *renderTexture = m_pApplication->GetRenderTarget();
	//
	//unsigned int viewWidth	= ( renderTexture != nullptr ) ? renderTexture->GetWidth()	: m_pApplication->GetWindowWidth();
	//unsigned int viewHeight = ( renderTexture != nullptr ) ? renderTexture->GetHeight()	: m_pApplication->GetWindowHeight();

	unsigned int viewWidth	= m_pApplication->GetViewWidth();
	unsigned int viewHeight = m_pApplication->GetViewHeight();

	//GetOrtho(m_projection, 0.0f, (float)viewWidth, (float)viewHeight, 0.0f, -1.0f, 100.0f);
	GetOrtho(m_projection, m_fCameraX, m_fCameraX + (float)viewWidth, m_fCameraY + (float)viewHeight, m_fCameraY, -1.0f, 100.0f);

	glUseProgram( m_shader );

	glUniformMatrix4fv( glGetUniformLocation(m_shader, "u_projection"), 1, false, m_projection );

	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

	SetRenderColor(0xFFFFFFFF);
}
void	CTestTraceline::Spawn( void )
{
	SetRenderColor( 255, 255, 255, 255 );
	SetNextThink( gpGlobals->curtime );

	SetThink( &CTestTraceline::Spin );
}
void CBaseGrenadeConcussion::Spawn( void )
{
	// point sized, solid, bouncing
	SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE );
	SetSolid( SOLID_BBOX );
	SetCollisionGroup( COLLISION_GROUP_PROJECTILE );
	SetModel( "models/weapons/w_grenade.mdl" );	// BUG: wrong model

	UTIL_SetSize(this, vec3_origin, vec3_origin);

	// contact grenades arc lower
	SetGravity( UTIL_ScaleForGravity( 400 ) );	// use a lower gravity for grenades to make them easier to see
	QAngle angles;
	VectorAngles(GetAbsVelocity(), angles );
	SetLocalAngles( angles );

	m_nRenderFX = kRenderFxGlowShell;
	SetRenderColor( 200, 200, 20, 255 );
	
	// make NPCs afaid of it while in the air
	SetThink( &CBaseGrenadeConcussion::FallThink );
	SetNextThink( gpGlobals->curtime );
	
	// Tumble in air
	QAngle vecAngVel( random->RandomFloat ( -100, -500 ), 0, 0 );
	SetLocalAngularVelocity( vecAngVel );
	
	// Explode on contact
	SetTouch( &CBaseGrenadeConcussion::ExplodeConcussion );

	m_flDamage = 80;

	// Allow player to blow this puppy up in the air
	m_takedamage	= DAMAGE_YES;
}
void CJaS_Marine_Jack::Spawn()
{
	CASW_Marine_Resource *pResource = dynamic_cast<CASW_Marine_Resource *>( CreateEntityByName( "asw_marine_resource" ) );
	pResource->SetProfileIndex( 6 );
	pResource->SetMarineEntity( this );
	SetMarineResource( pResource );
	pResource->Spawn();
	m_pProfileOverride = pResource->GetProfile();
	SelectModelFromProfile();
	SetModelFromProfile();

	CBaseCombatWeapon *pWeapon = dynamic_cast<CBaseCombatWeapon *>( CreateEntityByName( "asw_weapon_sniper_rifle" ) );
	if ( pWeapon )
	{
		pWeapon->Spawn();
		pWeapon->GiveDefaultAmmo();
		pWeapon->m_iClip1 = 9999;
		GiveAmmo(9999, pWeapon->GetPrimaryAmmoType());
		Weapon_Equip_In_Index( pWeapon, 0 );
		Weapon_Switch( pWeapon );
	}
	m_bConstantSlowHeal = true;

	m_hSquadFormation = static_cast<CASW_SquadFormation *>( CreateEntityByName( "asw_squadformation" ) );
	m_hSquadFormation->Leader( this );

	SetRenderColor( 0x99, 0x40, 0x40 );

	BaseClass::Spawn();
}
//=========================================================
// Spawn()
// Crear un nuevo 
//=========================================================
void CNPC_Scient::Spawn()
{
	Precache();

	// Modelo y color de sangre.
	SetModel(MODEL_BASE);
	SetBloodColor(BLOOD);

	// Tamaño
	SetHullType(HULL_WIDE_SHORT);
	SetHullSizeNormal();

	// Navegación, estado físico y opciones extra.
	SetSolid(SOLID_BBOX);
	SetNavType(NAV_GROUND);	
	AddSolidFlags(FSOLID_NOT_STANDABLE);
	SetMoveType(MOVETYPE_STEP);
	
	SetRenderColor(255, 255, 255, 255);
	SetDistLook(SEE_DIST);

	// Reseteo de variables.
	// Salud, estado del NPC y vista.
	m_iHealth			= sk_scient_health.GetFloat();
	m_NPCState			= NPC_STATE_NONE;
	m_flFieldOfView		= FOV;

	// Capacidades
	CapabilitiesClear();
	CapabilitiesAdd(CAPABILITIES);

	NPCInit();
	BaseClass::Spawn();
}
//=========================================================
// Spawn
//=========================================================
void CNPC_Bullsquid::Spawn()
{
	Precache( );

	SetModel( "models/bullsquid.mdl");
	SetHullType(HULL_WIDE_SHORT);
	SetHullSizeNormal();

	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_NOT_STANDABLE );
	SetMoveType( MOVETYPE_STEP );
	m_bloodColor		= BLOOD_COLOR_GREEN;
	
	SetRenderColor( 255, 255, 255, 255 );
	
	m_iHealth			= sk_bullsquid_health.GetFloat();
	m_flFieldOfView		= 0.2;// indicates the width of this monster's forward view cone ( as a dotproduct result )
	m_NPCState			= NPC_STATE_NONE;
	
	CapabilitiesClear();
	CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_INNATE_RANGE_ATTACK1 | bits_CAP_INNATE_MELEE_ATTACK1 | bits_CAP_INNATE_MELEE_ATTACK2 );
	
	m_fCanThreatDisplay	= TRUE;
	m_flNextSpitTime = gpGlobals->curtime;

	NPCInit();

	m_flDistTooFar		= 784;
}
//=========================================================
// Spawn
//=========================================================
void CNPC_HAssassin::Spawn()
{
	Precache( );

	SetModel( "models/hassassin.mdl");
	
	SetHullType(HULL_HUMAN);
	SetHullSizeNormal();


	SetNavType ( NAV_GROUND );
	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_NOT_STANDABLE );
	SetMoveType( MOVETYPE_STEP );
	m_bloodColor		= BLOOD_COLOR_RED;
    ClearEffects();
	m_iHealth			= sk_hassassin_health.GetFloat();
	m_flFieldOfView		= VIEW_FIELD_WIDE; // indicates the width of this monster's forward view cone ( as a dotproduct result )
	m_NPCState			= NPC_STATE_NONE;
	
	m_HackedGunPos		= Vector( 0, 24, 48 );

	m_iTargetRanderamt	= 20;
	SetRenderColor( 255, 255, 255, 20 );
	m_nRenderMode		= kRenderTransTexture;

	CapabilitiesClear();
	CapabilitiesAdd( bits_CAP_MOVE_GROUND );
	CapabilitiesAdd( bits_CAP_INNATE_RANGE_ATTACK1 | bits_CAP_INNATE_RANGE_ATTACK2 | bits_CAP_INNATE_MELEE_ATTACK1 );

	NPCInit();
}
void CNPC_Controller::Spawn()
{
	Precache( );

	SetModel( "models/controller.mdl" );
	UTIL_SetSize( this, Vector( -32, -32, 0 ), Vector( 32, 32, 64 ));

	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_NOT_STANDABLE );

	SetMoveType( MOVETYPE_STEP );
	SetGravity(0.001);


	m_bloodColor		= BLOOD_COLOR_GREEN;
	m_iHealth =			sk_controller_health.GetFloat();

	m_flFieldOfView		= VIEW_FIELD_FULL;// indicates the width of this monster's forward view cone ( as a dotproduct result )
	m_NPCState			= NPC_STATE_NONE;

	SetRenderColor( 255, 255, 255, 255 );

	CapabilitiesClear();

	AddFlag( FL_FLY );
	SetNavType( NAV_FLY );

	CapabilitiesAdd( bits_CAP_MOVE_FLY | bits_CAP_INNATE_RANGE_ATTACK1 | bits_CAP_INNATE_RANGE_ATTACK2 | bits_CAP_MOVE_SHOOT);

	NPCInit();

	
	SetDefaultEyeOffset();
}
//=========================================================
// Spawn
//=========================================================
void CNPC_HL1Barney::Spawn()
{
	Precache( );

	SetModel( "models/hl1bar.mdl");

	SetRenderColor( 255, 255, 255, 255 );
	
	SetHullType(HULL_HUMAN);
	SetHullSizeNormal();

	SetSolid( SOLID_BBOX );
	AddSolidFlags( FSOLID_NOT_STANDABLE );
	SetMoveType( MOVETYPE_STEP );
	m_bloodColor		= BLOOD_COLOR_RED;
	m_iHealth			= sk_barneyhl1_health.GetFloat();
	SetViewOffset( Vector ( 0, 0, 100 ) );// 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_NPCState			= NPC_STATE_NONE;

	SetBodygroup( 1, 0 );

	m_fGunDrawn			= false;

	CapabilitiesClear();
	CapabilitiesAdd( bits_CAP_MOVE_GROUND | bits_CAP_OPEN_DOORS | bits_CAP_AUTO_DOORS | bits_CAP_USE | bits_CAP_DOORS_GROUP);
	CapabilitiesAdd( bits_CAP_INNATE_RANGE_ATTACK1 | bits_CAP_TURN_HEAD | bits_CAP_ANIMATEDFACE );
	
	NPCInit();
	
	SetUse( &CNPC_HL1Barney::FollowerUse );
}
Exemple #12
0
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 );
}
//=========================================================
// Establece el color de la ropa
//=========================================================
void CAP_PlayerInfected::SetClothColor()
{
	int iRand = RandomInt(0, 7);

	switch ( iRand )
	{
		case 0:
			SetRenderColor( 97, 11, 11 );
		break;

		case 1:
			SetRenderColor( 11, 56, 97 );
		break;

		case 2:
			SetRenderColor( 11, 97, 11 );
		break;

		case 3:
			SetRenderColor( 110, 110, 110 );
		break;

		case 4:
			SetRenderColor( 42, 18, 10 );
		break;

		case 5:
			SetRenderColor( 180, 95, 4 );
		break;

		case 6:
			SetRenderColor( 0, 0, 0 );
		break;
	}
}
SpriteBatch::SpriteBatch(Application *pApp)
{
	m_pApplication = pApp;
	SetRenderColor(255,255,255,255);
	SetUVRect(0.0f, 0.0f, 1.0f, 1.0f);
	unsigned int pixels[1] = {0xFFFFFFFF};
	m_nullTexture = new Texture(1,1, pixels);
	m_transformColumnMajor = false;
}
	void Spawn()
	{
		Precache();
		SetModel( STRING( GetModelName() ) );
		SetSolid( SOLID_NONE );
		SetMoveType( MOVETYPE_NONE );
		AddEffects( EF_NOSHADOW );
		SetRenderColor( 255, 0, 0 );
		m_isInert = false;
	}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CMapClass::SetColorFromVisGroups(void)
{
	if (m_pVisGroup)
	{
		// set group color
		color32 rgbColor = m_pVisGroup->GetColor();
		SetRenderColor(rgbColor);
	}
	else if (Parent && !Parent->IsWorldObject())
	{
		color32 rgbColor = Parent->GetRenderColor();
		SetRenderColor(rgbColor);
	}
	else
	{
		// random blue/green
		SetRenderColor(0, 100 + (random() % 156), 100 + (random() % 156));
	}
}
Exemple #17
0
SporeExplosion::SporeExplosion( void )
{
	m_flSpawnRate			= 100.0f;
	m_flParticleLifetime	= 1.0f;
	m_flStartSize			= 1.0f;
	m_flEndSize				= 0.0f;
	m_flSpawnRadius			= 16.0f;
	SetRenderColor( 255, 255, 255, 255 );
	m_bEmit = true;
	m_bDisabled = false;
}
Exemple #18
0
SporeTrail::SporeTrail( void )
{
	m_vecEndColor.GetForModify().Init();

	m_flSpawnRate			= 100.0f;
	m_flParticleLifetime	= 1.0f;
	m_flStartSize			= 1.0f;
	m_flEndSize				= 0.0f;
	m_flSpawnRadius			= 16.0f;
	SetRenderColor( 255, 255, 255, 255 );
}
void CNPC_BabyCrab :: Spawn( void )
{
	CNPC_Headcrab::Spawn();
	SetModel( "models/baby_headcrab.mdl" );
	m_nRenderMode = kRenderTransTexture;

	SetRenderColor( 255, 255, 255, 192 );

	UTIL_SetSize(this, Vector(-12, -12, 0), Vector(12, 12, 24));
	
	m_iHealth	  = sk_headcrab_health.GetFloat() * 0.25;	// less health than full grown
}
//-----------------------------------------------------------------------------
// Purpose: 
// Output : Returns true if the color was specified by this call, false if not.
//-----------------------------------------------------------------------------
bool CMapClass::UpdateObjectColor(void)
{
	//
	// The user can choose a visgroup from which to get the color from.
	// If one was chosen, set our color from that visgroup.
	//
	if (m_pColorVisGroup)
	{
		color32 rgbColor = m_pColorVisGroup->GetColor();
		SetRenderColor(rgbColor);
		return true;
	}
	else if (m_pParent && !IsWorldObject(m_pParent))
	{
		color32 rgbColor = m_pParent->GetRenderColor();
		SetRenderColor(rgbColor);
		return true;
	}

	return false;
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CWeaponSpawner::Materialize( void )
{
	BaseClass::Materialize();

	if ( !IsDisabled() )
	{
		EmitSound( "Item.Materialize" );
		CPVSFilter filter( GetAbsOrigin() );
		//TE_TFParticleEffect( filter, 0.0f, RESPAWN_PARTICLE, GetAbsOrigin(), QAngle( 0,0,0 ) );
		AddEffects( EF_ITEM_BLINK );
		m_nRenderFX = kRenderFxNone;
		SetRenderColor( 255, 255, 255, 255 );
	}
}
void CGEPropDynamic::Materialize(void)
{
	//A more lightweight and optional func_rebreakable materalize function 
	CreateVPhysics();

	if (m_bRobustSpawn)
	{
		// iterate on all entities in the vicinity.
		CBaseEntity *pEntity;
		Vector max = CollisionProp()->OBBMaxs();
		for (CEntitySphereQuery sphere(GetAbsOrigin(), max.NormalizeInPlace()); (pEntity = sphere.GetCurrentEntity()) != NULL; sphere.NextEntity())
		{
			if (pEntity == this || pEntity->GetSolid() == SOLID_NONE || pEntity->GetSolid() == SOLID_BSP || pEntity->GetSolidFlags() & FSOLID_NOT_SOLID || pEntity->GetMoveType() & MOVETYPE_NONE)
				continue;

			// Ignore props that can't move
			if (pEntity->VPhysicsGetObject() && !pEntity->VPhysicsGetObject()->IsMoveable())
				continue;

			// Prevent respawn if we are blocked by anything and try again in 1 second
			if (Intersects(pEntity))
			{
				SetSolid(SOLID_NONE);
				AddSolidFlags(FSOLID_NOT_SOLID);
				VPhysicsDestroyObject();
				SetNextThink(gpGlobals->curtime + 1.0f);
				return;
			}
		}
	}

	m_iHealth = m_iHealthOverride;

	if (m_iHealth > 0)
		m_takedamage = DAMAGE_YES;

	RemoveEffects(EF_NODRAW);
	RemoveSolidFlags(FSOLID_NOT_SOLID);

	m_bUsingBrokenSkin = false;

	if (m_bUseRandomSkins)
		PickNewSkin();
	else
		m_nSkin = m_iStartingSkin;

	SetRenderColor(m_col32basecolor.r, m_col32basecolor.g, m_col32basecolor.b);

	m_Respawn.FireOutput(this, this);
}
//-----------------------------------------------------------------------------
// Make a model look as though it's burning. 
//-----------------------------------------------------------------------------
void CAnimating::Scorch( int rate, int floor )
{
	color32 color = GetRenderColor();

	if( color.r > floor )
		color.r -= rate;

	if( color.g > floor )
		color.g -= rate;

	if( color.b > floor )
		color.b -= rate;

	SetRenderColor( color.r, color.g, color.b );
}
//-----------------------------------------------------------------------------
// Purpose: Called before spawning, after key values have been set.
//-----------------------------------------------------------------------------
CSmokeStack::CSmokeStack()
{
	memset( &m_AmbientLight, 0, sizeof(m_AmbientLight) ); 
	memset( &m_DirLight, 0, sizeof(m_DirLight) ); 

	IMPLEMENT_NETWORKVAR_CHAIN( &m_AmbientLight );
	IMPLEMENT_NETWORKVAR_CHAIN( &m_DirLight );

	m_flTwist = 0;
	SetRenderColor( 0, 0, 0, 255 );
	m_vWind.GetForModify().Init();
	m_WindAngle = m_WindSpeed = 0;
	m_iMaterialModel = -1;
	m_flRollSpeed = 0.0f;
}
//-----------------------------------------------------------------------------
// Spawn
//-----------------------------------------------------------------------------
void CEntityDissolve::Spawn()
{
	BaseClass::Spawn();
	Precache();
	UTIL_SetModel( this, STRING( GetModelName() ) );

	if ( (m_nDissolveType == ENTITY_DISSOLVE_ELECTRICAL) || (m_nDissolveType == ENTITY_DISSOLVE_ELECTRICAL_LIGHT) )
	{
		if ( dynamic_cast< CRagdollProp* >( GetMoveParent() ) )
		{
			SetContextThink( &CEntityDissolve::ElectrocuteThink, gpGlobals->curtime + 0.01f, s_pElectroThinkContext );
		}
	}
	
	// Setup our times
	m_flFadeInStart = DISSOLVE_FADE_IN_START_TIME;
	m_flFadeInLength = DISSOLVE_FADE_IN_END_TIME - DISSOLVE_FADE_IN_START_TIME;
	
	m_flFadeOutModelStart = DISSOLVE_FADE_OUT_MODEL_START_TIME;
	m_flFadeOutModelLength = DISSOLVE_FADE_OUT_MODEL_END_TIME - DISSOLVE_FADE_OUT_MODEL_START_TIME;
	
	m_flFadeOutStart = DISSOLVE_FADE_OUT_START_TIME;
	m_flFadeOutLength = DISSOLVE_FADE_OUT_END_TIME - DISSOLVE_FADE_OUT_START_TIME;

	if ( m_nDissolveType == ENTITY_DISSOLVE_CORE )
	{
		m_flFadeInStart = 0.0f;
		m_flFadeOutStart = CORE_DISSOLVE_FADE_START;
		m_flFadeOutModelStart = CORE_DISSOLVE_MODEL_FADE_START;
		m_flFadeOutModelLength = CORE_DISSOLVE_MODEL_FADE_LENGTH;
		m_flFadeInLength = CORE_DISSOLVE_FADEIN_LENGTH;
	}

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

	SetThink( &CEntityDissolve::DissolveThink );
	if ( gpGlobals->curtime > m_flStartTime )
	{
		// Necessary for server-side ragdolls
		DissolveThink();
	}
	else
	{
		SetNextThink( gpGlobals->curtime + 0.01f );
	}
}
Exemple #26
0
//-----------------------------------------------------------------------------
// Purpose: Sets up the entity's initial state
//-----------------------------------------------------------------------------
void GhostEntity::Spawn( void )
{
	Precache();
	if (GhostEngine::getEngine()->shouldDrawTrails()) {
		if (ghostData.trailLength > 0) {
			CreateTrail();
		}
	}
	RemoveEffects(EF_NODRAW);
	SetModel(MODEL);
	SetSolid( SOLID_NONE );
	SetRenderMode(kRenderTransColor);
	SetRenderColor(ghostData.ghostRed, ghostData.ghostGreen, ghostData.ghostBlue);
	SetRenderColorA(75);
	SetMoveType( MOVETYPE_NOCLIP );
	isActive = true;
}
// Fade the projectile out over time before making it disappear
void CSmokeGrenadeProjectile::Think_Fade()
{
	SetNextThink( gpGlobals->curtime );

	color32 c = GetRenderColor();
	c.a -= 1;
	SetRenderColor( c.r, c.b, c.g, c.a );

	if ( !c.a )
	{
		TheBots->RemoveGrenade( this );

		SetModelName( NULL_STRING );//invisible
		SetNextThink( gpGlobals->curtime + 20 );
		SetThink( &CSmokeGrenadeProjectile::Think_Remove );	// Spit out smoke for 10 seconds.
		SetSolid( SOLID_NONE );
	}
}
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
CBaseViewModel::CBaseViewModel()
{
#if defined( CLIENT_DLL )
	// NOTE: We do this here because the color is never transmitted for the view model.
	m_nOldAnimationParity = 0;
	m_EntClientFlags |= ENTCLIENTFLAG_ALWAYS_INTERPOLATE;
#endif
	SetRenderColor( 255, 255, 255, 255 );

	// View model of this weapon
	m_sVMName			= NULL_STRING;		
	// Prefix of the animations that should be used by the player carrying this weapon
	m_sAnimationPrefix	= NULL_STRING;

	m_nViewModelIndex	= 0;

	m_nAnimationParity	= 0;
}
// Fade the projectile out over time before making it disappear
void CDODSmokeGrenade::Think_Fade()
{
	m_bFading = true;

	SetNextThink( gpGlobals->curtime );

	color32 c = GetRenderColor();
	c.a -= 1;
	SetRenderColor( c.r, c.b, c.g, c.a );

	if ( !c.a )
	{
		SetModelName( NULL_STRING );//invisible
		SetNextThink( gpGlobals->curtime + 10 );
		SetThink( &CDODSmokeGrenade::Think_Remove );	// Spit out smoke for 10 seconds.
		SetSolid( SOLID_NONE );
	}
}
void CStickyBomb::Spawn()
{
	m_hOperator = GetOwnerEntity();
	Precache();
	SetModel( STICKY_BOMB_MODEL );
	SetSolid( SOLID_BBOX );
	SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_CUSTOM );
	SetCollisionGroup( COLLISION_GROUP_NONE );
	m_takedamage = DAMAGE_NO;
	SetNextThink( TICK_NEVER_THINK );
	m_flAnimTime = gpGlobals->curtime;
	m_flPlaybackRate = 0.0;
	m_flCycle = 0;
	UTIL_SetSize( this, vec3_origin, vec3_origin );
	Relink();
	// no shadows, please.
	m_fEffects |= EF_NOSHADOW|EF_NORECEIVESHADOW;
	SetRenderColor( 255, 0, 0 );
}