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; }
//------------------------------------------------------------------------------ // Spawn //------------------------------------------------------------------------------ void CQUAGrenadeHelicopter::Spawn( void ) { Precache(); // point sized, solid, bouncing SetCollisionGroup( COLLISION_GROUP_PROJECTILE ); SetModel( "models/combine_helicopter/helicopter_bomb01.mdl" ); SetSolid( SOLID_BBOX ); SetCollisionBounds( Vector( -12.5, -12.5, -12.5 ), Vector( 12.5, 12.5, 12.5 ) ); VPhysicsInitShadow( false, false ); SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_CUSTOM ); SetElasticity( 0.5f ); AddEffects( EF_NOSHADOW ); // We're always being dropped beneath the helicopter; need to not // be affected by the rotor wash AddEFlags( EFL_NO_ROTORWASH_PUSH ); // 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 ); SetThink( NULL ); // Tumble in air QAngle vecAngVel( random->RandomFloat ( -100, -500 ), 0, 0 ); SetLocalAngularVelocity( vecAngVel ); // Explode on contact SetTouch( &CQUAGrenadeHelicopter::ExplodeConcussion ); m_bActivated = false; m_pWarnSound = NULL; m_flDamage = 75.0; // Allow player to blow this puppy up in the air m_takedamage = DAMAGE_YES; g_pNotify->AddEntity( this, this ); }
//----------------------------------------------------------------------------- // Purpose: Setup basic values for Thrown grens //----------------------------------------------------------------------------- void CThrownGrenade::Spawn( void ) { // point sized, solid, bouncing SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_BOUNCE ); SetSolid( SOLID_BBOX ); UTIL_SetSize(this, vec3_origin, vec3_origin); // Movement SetGravity( UTIL_ScaleForGravity( 648 ) ); SetFriction(0.6); QAngle angles; VectorAngles( GetAbsVelocity(), angles ); SetLocalAngles( angles ); QAngle vecAngVel( random->RandomFloat ( -100, -500 ), 0, 0 ); SetLocalAngularVelocity( vecAngVel ); SetTouch( &CThrownGrenade::BounceTouch ); }