• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RadiusDamage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Killed

void CSqueakGrenade :: Killed( entvars_t *pevAttacker, int iGib )
{
	pev->model = iStringNull;// make invisible
	SetThink( SUB_Remove );
	SetTouch( NULL );
	pev->nextthink = gpGlobals->time + 0.1;

	// since squeak grenades never leave a body behind, clear out their takedamage now.
	// Squeaks do a bit of radius damage when they pop, and that radius damage will
	// continue to call this function unless we acknowledge the Squeak's death now. (sjb)
	pev->takedamage = DAMAGE_NO;

	// play squeek blast
	EMIT_SOUND_DYN(ENT(pev), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5, 0, PITCH_NORM);	

	CSoundEnt::InsertSound ( bits_SOUND_COMBAT, pev->origin, SMALL_EXPLOSION_VOLUME, 3.0 );

	UTIL_BloodDrips( pev->origin, g_vecZero, BloodColor(), 80 );

	if (m_hOwner != NULL)
		RadiusDamage ( pev, m_hOwner->pev, pev->dmg, CLASS_NONE, DMG_BLAST );
	else
		RadiusDamage ( pev, pev, pev->dmg, CLASS_NONE, DMG_BLAST );

	// reset owner so death message happens
	if (m_hOwner != NULL)
		pev->owner = m_hOwner->edict();

	CBaseMonster :: Killed( pevAttacker, GIB_ALWAYS );
}
开发者ID:vermagav,项目名称:mechmod,代码行数:30,代码来源:squeakgrenade.cpp


示例2: Assert

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CGrenadeRocket::MissileTouch( CBaseEntity *pOther )
{
	Assert( pOther );
	if ( !pOther->IsSolid() )
		return;

	Vector vecAbsOrigin = GetAbsOrigin();
	CPASFilter filter( vecAbsOrigin );
	te->Explosion( filter, 0.0,	&vecAbsOrigin, g_sModelIndexFireball, 2.0, 15, TE_EXPLFLAG_NONE, 100, m_flDamage );

	StopSound( "GrenadeRocket.FlyLoop" );

	// Don't apply explosive damage if it hit a shield of any kind...
	bool bHittingShield = false;
	if (pOther->GetCollisionGroup() == TFCOLLISION_GROUP_SHIELD)
	{
		bHittingShield = true;
	}
	else if ( pOther->IsPlayer() )
	{
		CBaseTFPlayer *pPlayer = static_cast<CBaseTFPlayer*>(pOther);

		trace_t tr;
		float flDamage = m_flDamage;
		bHittingShield = pPlayer->IsHittingShield( GetAbsVelocity(), &flDamage );
	}

	if (!bHittingShield)
	{
		RadiusDamage( CTakeDamageInfo( this, m_pRealOwner, m_flDamage, DMG_BLAST ), vecAbsOrigin, 100, CLASS_NONE );
	}

	UTIL_Remove( this );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:37,代码来源:grenade_rocket.cpp


示例3: DispatchParticleEffect

void CWeaponDrainGrenade::Explode( CBaseCombatCharacter* pAttacker,
						   CBaseEntity* pInflictor,
						   CBaseEntity* pIgnore,
						   Vector vecPosition,
						   float flDamage,
						   float flRadius,
						   float flDrainFocus )
{

#if !defined( CLIENT_DLL )
	//CSoundEnt::InsertSound ( SOUND_COMBAT, vecPosition, 1024, 3.0 );
	
	CTakeDamageInfo info;
	info.CFSet( pInflictor, pAttacker, vec3_origin, vecPosition, flDamage, DMG_BLAST, WEAPON_NONE, &vecPosition, false );
	info.SetDrainFocus( flDrainFocus );

	DispatchParticleEffect("grenade_explosion", vecPosition, vec3_angle, pIgnore);

	//TODO: Figure out sound.
	CPASAttenuationFilter filter( this );
	filter.UsePredictionRules();
	EmitSound( filter, entindex(), "Numen.FireAoE" );
	//CSoundEnt::InsertSound ( SOUND_COMBAT, GetAbsOrigin(), BASEGRENADE_EXPLOSION_VOLUME, 3.0 );
	
	RadiusDamage( info, vecPosition, flRadius );

#endif //!defined( CLIENT_DLL )
}
开发者ID:BSVino,项目名称:Arcon,代码行数:28,代码来源:weapon_draingrenade.cpp


示例4: UTIL_TraceLine

void CGrenadeSpit::GrenadeSpitTouch( CBaseEntity *pOther )
{
	if (m_fSpitDeathTime != 0)
	{
		return;
	}
	if ( pOther->GetCollisionGroup() == HL2COLLISION_GROUP_SPIT)
	{
		return;
	}
	if ( !pOther->m_takedamage )
	{

		// make a splat on the wall
		trace_t tr;
		UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + GetAbsVelocity() * 10, MASK_SOLID, this, COLLISION_GROUP_NONE, &tr );
		UTIL_DecalTrace(&tr, "BeerSplash" );

		// make some flecks
		// CPVSFilter filter( tr.endpos );
		//te->SpriteSpray( filter, 0.0,
		//	tr.endpos, tr.plane.normal, m_nSquidSpitSprite, 30, 0.8, 5 );
	}
	else
	{
		RadiusDamage ( CTakeDamageInfo( this, GetThrower(), m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_DmgRadius, CLASS_NONE, NULL );
	}

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


示例5: FX_Trail

void CMmissile::ExplodeTouch( CBaseEntity *pOther )
{
	if ( UTIL_PointContents(pev->origin) == CONTENT_SKY )
	{
		FX_Trail( pev->origin, entindex(), PROJ_REMOVE );
		UTIL_Remove( this );
		return;
	}
	if (pOther->pev->health == 666)
	{
		return;
	}
	TraceResult tr;
	Vector vecSpot = pev->origin - pev->velocity.Normalize() * 32;
	Vector vecEnd = pev->origin + pev->velocity.Normalize() * 64;
	UTIL_TraceLine( vecSpot, vecEnd, ignore_monsters, ENT(pev), &tr );

	entvars_t *pevOwner = VARS( pev->owner );
	RadiusDamage ( pev, pevOwner, pev->dmg, CLASS_NONE, DMG_BLAST );
	FX_Trail( tr.vecEndPos + (tr.vecPlaneNormal * 15), entindex(), (UTIL_PointContents(pev->origin) == CONTENT_WATER)?PROJ_MMISSILE_DETONATE_WATER:PROJ_MMISSILE_DETONATE );

	int tex = (int)TEXTURETYPE_Trace(&tr, vecSpot, vecEnd);
	CBaseEntity *pEntity = CBaseEntity::Instance(tr.pHit);
	FX_ImpRocket( tr.vecEndPos, tr.vecPlaneNormal, pEntity->IsBSPModel()?1:0, BULLET_SMALEXP, (float)tex );

	if (pOther->pev->takedamage)
	{
		ClearMultiDamage( );
		pOther->TraceAttack(pevOwner, pev->dmg/3, gpGlobals->v_forward, &tr, DMG_BULLETMAGNUM ); 
		ApplyMultiDamage( pev, pevOwner);
	}
	UTIL_Remove( this );
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:33,代码来源:proj_mmissile.cpp


示例6: Vector

void CEnvExplosion::RealUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{ 
	pev->model = iStringNull;//invisible
	pev->solid = SOLID_NOT;// intangible
	pev->origin = pev->origin + Vector(0,0,12);

	// do damage
	if ( !( pev->spawnflags & SF_ENVEXPLOSION_NODAMAGE ) )
		RadiusDamage ( pev, pev, m_iMagnitude, CLASS_NONE, DMG_BLAST );

	MESSAGE_BEGIN( MSG_ALL, gmsgWorldExp );
	WRITE_COORD( pev->origin.x );
	WRITE_COORD( pev->origin.y );
	WRITE_COORD( pev->origin.z );
	WRITE_SHORT( m_spriteScale );
	WRITE_BYTE( (pev->spawnflags & SF_ENVEXPLOSION_NOSMOKE)?0:1 );
	WRITE_BYTE( (pev->spawnflags & SF_ENVEXPLOSION_NOSPARKS)?0:1 );
	WRITE_BYTE( (pev->spawnflags & SF_ENVEXPLOSION_NOFIREBALL)?0:1 );
	WRITE_BYTE( (pev->spawnflags & SF_ENVEXPLOSION_NORING)?0:1 );
	WRITE_BYTE( (pev->spawnflags & SF_ENVEXPLOSION_NODECAL)?0:1 );
	MESSAGE_END();

	if ( !(pev->spawnflags & SF_ENVEXPLOSION_REPEATABLE) )
		UTIL_Remove( this );
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:25,代码来源:explode.cpp


示例7: DesintegrateThink

void CBlackHole :: DesintegrateThink( void )
{
	entvars_t *pevOwner = VARS( pev->owner );

	if (UTIL_PointContents ( pev->origin ) == CONTENTS_WATER)
	{
		::RadiusDamage( pev->origin, pev, pevOwner, (dmg_chrono_radius.value/2) * (mp_wpn_power.value/100), dmg_chrono_radius.value * (mp_wpn_power.value/100), CLASS_NONE, DMG_SONIC);
		FX_Trail( pev->origin, entindex(), PROJ_BLACKHOLE_DETONATE );
		UTIL_Remove( this );
		return;
	}

	::FullRadiusDamage( pev->origin, pev, pevOwner, 999, 200, CLASS_NONE, DMG_ANNIHILATION);
	RadiusDamage();

 	pev->frags--;
	if (pev->frags <= 0)
	{
		::RadiusDamage( pev->origin, pev, pevOwner, (dmg_chrono_radius.value/2) * (mp_wpn_power.value/100), dmg_chrono_radius.value* (mp_wpn_power.value/100), CLASS_NONE, DMG_SONIC);
		FX_Trail( pev->origin, entindex(), PROJ_BLACKHOLE_DETONATE );
		UTIL_Remove( this );
		return;
	}
	pev->nextthink = gpGlobals->time + 0.1;
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:25,代码来源:proj_blackhole.cpp


示例8: ExplosionCreate

void CPropCannon::ProjectileExplosion( void )
{
	ExplosionCreate( m_vCrashPoint, vec3_angle, NULL, 512, 512, false );

	// do damage
	CTakeDamageInfo info( this, this, g_cannon_damageandradius.GetInt(), DMG_BLAST );

	info.SetDamagePosition( m_vCrashPoint );
	RadiusDamage( info, m_vCrashPoint, g_cannon_damageandradius.GetInt(), CLASS_NONE, NULL );
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:10,代码来源:vehicle_cannon.cpp


示例9: RadiusDamage

//-----------------------------------------------------------------------------
// Purpose: Explode and die
//-----------------------------------------------------------------------------
void CBasePlasmaProjectile::Detonate( void )
{
#if !defined( CLIENT_DLL )
	// Should I explode?
	if ( m_flExplosiveRadius )
	{
		RadiusDamage( CTakeDamageInfo( this, GetOwnerEntity(), m_flDamage, m_DamageType | DMG_BLAST ), GetAbsOrigin(), m_flExplosiveRadius, CLASS_NONE, NULL );
	}
#endif
	Remove( );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:14,代码来源:plasmaprojectile.cpp


示例10: FlameUpdate

void CMGargantua :: FlameUpdate( void )
{
	int				i;
	static float	offset[2] = { 60, -60 };
	TraceResult		trace;
	Vector			vecStart, angleGun;
	BOOL			streaks = FALSE;

	for ( i = 0; i < 2; i++ )
	{
		if ( m_pFlame[i] )
		{
			Vector vecAim = pev->angles;
			vecAim.x += m_flameX;
			vecAim.y += m_flameY;

			UTIL_MakeVectors( vecAim );

			GetAttachment( i+1, vecStart, angleGun );
			Vector vecEnd = vecStart + (gpGlobals->v_forward * GARG_FLAME_LENGTH); //  - offset[i] * gpGlobals->v_right;

			UTIL_TraceLine( vecStart, vecEnd, dont_ignore_monsters, edict(), &trace );

			m_pFlame[i]->SetStartPos( trace.vecEndPos );
			m_pFlame[i+2]->SetStartPos( (vecStart * 0.6) + (trace.vecEndPos * 0.4) );

			if ( trace.flFraction != 1.0 && gpGlobals->time > m_streakTime )
			{
				StreakSplash( trace.vecEndPos, trace.vecPlaneNormal, 6, 20, 50, 400 );
				streaks = TRUE;
				UTIL_DecalTrace( &trace, DECAL_SMALLSCORCH1 + RANDOM_LONG(0,2) );
			}
			RadiusDamage( trace.vecEndPos, pev, pev, gSkillData.gargantuaDmgFire, CLASS_ALIEN_MONSTER, DMG_BURN );
			FlameDamage( vecStart, trace.vecEndPos, pev, pev, gSkillData.gargantuaDmgFire, CLASS_ALIEN_MONSTER, DMG_BURN );

			MESSAGE_BEGIN( MSG_BROADCAST, SVC_TEMPENTITY );
				WRITE_BYTE( TE_ELIGHT );
				WRITE_SHORT( entindex( ) + 0x1000 * (i + 2) );		// entity, attachment
				WRITE_COORD( vecStart.x );		// origin
				WRITE_COORD( vecStart.y );
				WRITE_COORD( vecStart.z );
				WRITE_COORD( RANDOM_FLOAT( 32, 48 ) );	// radius
				WRITE_BYTE( 255 );	// R
				WRITE_BYTE( 255 );	// G
				WRITE_BYTE( 255 );	// B
				WRITE_BYTE( 2 );	// life * 10
				WRITE_COORD( 0 ); // decay
			MESSAGE_END();
		}
	}
	if ( streaks )
		m_streakTime = gpGlobals->time;
}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:53,代码来源:gargantua.cpp


示例11: filter

void CGrenadeMP5::Detonate(void)
{
	if (!m_bIsLive)
	{
		return;
	}
	m_bIsLive		= false;
	m_takedamage	= DAMAGE_NO;	

	CPASFilter filter( GetAbsOrigin() );

	te->Explosion( filter, 0.0,
		&GetAbsOrigin(), 
		GetWaterLevel() == 0 ? g_sModelIndexFireball : g_sModelIndexWExplosion,
		(m_flDamage - 50) * .60, 
		15,
		TE_EXPLFLAG_NONE,
		m_DmgRadius,
		m_flDamage );

	trace_t tr;	
	tr = CBaseEntity::GetTouchTrace();

	if ( (tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0) )
	{
		// non-world needs smaller decals
		UTIL_DecalTrace( &tr, "SmallScorch");
	}
	else
	{
		UTIL_DecalTrace( &tr, "Scorch" );
	}

	CSoundEnt::InsertSound ( SOUND_COMBAT, GetAbsOrigin(), BASEGRENADE_EXPLOSION_VOLUME, 3.0 );

	RadiusDamage ( CTakeDamageInfo( this, GetThrower(), m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_flDamage * 2.5, CLASS_NONE, NULL );

	CPASAttenuationFilter filter2( this );
	EmitSound( filter2, entindex(), "GrenadeMP5.Detonate" );

	if ( GetWaterLevel() == 0 )
	{
		int sparkCount = random->RandomInt( 0,3 );
		QAngle angles;
		VectorAngles( tr.plane.normal, angles );

		for ( int i = 0; i < sparkCount; i++ )
			Create( "spark_shower", GetAbsOrigin(), angles, NULL );
	}

	UTIL_Remove( this );
}
开发者ID:hitmen047,项目名称:TF2HLCoop,代码行数:52,代码来源:hl1_grenade_mp5.cpp


示例12: UTIL_Remove

void CGrenadeAR2::Detonate(void)
{
	if (!m_bIsLive)
	{
		return;
	}
	m_bIsLive		= false;
	m_takedamage	= DAMAGE_NO;	

	if(m_hSmokeTrail)
	{
		UTIL_Remove(m_hSmokeTrail);
		m_hSmokeTrail = NULL;
	}

	CPASFilter filter( GetAbsOrigin() );

	te->Explosion( filter, 0.0,
		&GetAbsOrigin(), 
		g_sModelIndexFireball,
		2.0, 
		15,
		TE_EXPLFLAG_NONE,
		m_DmgRadius,
		m_flDamage );

	Vector vecForward = GetAbsVelocity();
	VectorNormalize(vecForward);
	trace_t		tr;
	UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + 60*vecForward, MASK_SHOT, 
		this, COLLISION_GROUP_NONE, &tr);


	if ((tr.m_pEnt != GetWorldEntity()) || (tr.hitbox != 0))
	{
		// non-world needs smaller decals
		if( tr.m_pEnt && !tr.m_pEnt->IsNPC() )
		{
			UTIL_DecalTrace( &tr, "SmallScorch" );
		}
	}
	else
	{
		UTIL_DecalTrace( &tr, "Scorch" );
	}

	UTIL_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START );

	RadiusDamage ( CTakeDamageInfo( this, GetThrower(), m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_DmgRadius, CLASS_NONE, NULL );

	UTIL_Remove( this );
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:52,代码来源:grenade_ar2.cpp


示例13: SetThink

void CSnark::Event_Killed( const CTakeDamageInfo &inputInfo )
{
//	pev->model = iStringNull;// make invisible
	SetThink( &CSnark::SUB_Remove );
	SetNextThink( gpGlobals->curtime + 0.1f );
	SetTouch( NULL );

	// since squeak grenades never leave a body behind, clear out their takedamage now.
	// Squeaks do a bit of radius damage when they pop, and that radius damage will
	// continue to call this function unless we acknowledge the Squeak's death now. (sjb)
	m_takedamage = DAMAGE_NO;

	// play squeek blast
	CPASAttenuationFilter filter( this, 0.5 );
	enginesound->EmitSound( filter, entindex(), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5, 0, PITCH_NORM );

	CSoundEnt::InsertSound( SOUND_COMBAT, GetAbsOrigin(), SNARK_EXPLOSION_VOLUME, 3.0 );

	UTIL_BloodDrips( WorldSpaceCenter(), Vector( 0, 0, 0 ), BLOOD_COLOR_YELLOW, 80 );

	if ( m_hOwner != NULL )
	{
		RadiusDamage( CTakeDamageInfo( this, m_hOwner, GetDamage(), DMG_BLAST ), GetAbsOrigin(), GetDamage() * 2.5, CLASS_NONE );
	}
	else
	{
		RadiusDamage( CTakeDamageInfo( this, this, GetDamage(), DMG_BLAST ), GetAbsOrigin(), GetDamage() * 2.5, CLASS_NONE );
	}

	// reset owner so death message happens
	if ( m_hOwner != NULL )
		SetOwnerEntity( m_hOwner );

	CTakeDamageInfo info = inputInfo;
	info.SetDamageType( DMG_GIB_CORPSE );

	BaseClass::Event_Killed( info );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:38,代码来源:hl1_npc_snark.cpp


示例14: SetThink

//-----------------------------------------------------------------------------
// Purpose: Burn targets around us
//-----------------------------------------------------------------------------
void CEntityFlame::FlameThink( void )
{
	if ( m_flLifetime < gpGlobals->curtime )
	{
		SetThink( &CEntityFlame::SUB_Remove );
		SetNextThink( gpGlobals->curtime + 0.1f );
		return;
	}

	RadiusDamage( CTakeDamageInfo( this, this, 4.0f, DMG_BURN ), GetAbsOrigin(), m_flSize/2, CLASS_NONE );
	FireSystem_AddHeatInRadius( GetAbsOrigin(), m_flSize/2, 2.0f );

	SetNextThink( gpGlobals->curtime + 0.1f );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:17,代码来源:EntityFlame.cpp


示例15: SetModelName

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CTFBaseRocket::Explode( trace_t *pTrace, CBaseEntity *pOther )
{
	// Save this entity as enemy, they will take 100% damage.
	m_hEnemy = pOther;

	// Invisible.
	SetModelName( NULL_STRING );
	AddSolidFlags( FSOLID_NOT_SOLID );
	m_takedamage = DAMAGE_NO;

	// Pull out a bit.
	if ( pTrace->fraction != 1.0 )
	{
		SetAbsOrigin( pTrace->endpos + ( pTrace->plane.normal * 1.0f ) );
	}

	// Play explosion sound and effect.
	Vector vecOrigin = GetAbsOrigin();
	CPVSFilter filter( vecOrigin );
	TE_TFExplosion( filter, 0.0f, vecOrigin, pTrace->plane.normal, GetWeaponID(), pOther->entindex() );
	CSoundEnt::InsertSound ( SOUND_COMBAT, vecOrigin, 1024, 3.0 );

	// Damage.
	CBaseEntity *pAttacker = GetOwnerEntity();
	IScorer *pScorerInterface = dynamic_cast<IScorer*>( pAttacker );
	if ( pScorerInterface )
	{
		pAttacker = pScorerInterface->GetScorer();
	}

	CTakeDamageInfo info( this, pAttacker, vec3_origin, vecOrigin, GetDamage(), GetDamageType() );
	float flRadius = GetRadius();
	RadiusDamage( info, vecOrigin, flRadius, CLASS_NONE, NULL );

	// Debug!
	if ( tf_rocket_show_radius.GetBool() )
	{
		DrawRadius( flRadius );
	}

	// Don't decal players with scorch.
	if ( !pOther->IsPlayer() )
	{
		UTIL_DecalTrace( pTrace, "Scorch" );
	}

	// Remove the rocket.
	UTIL_Remove( this );
}
开发者ID:staticfox,项目名称:TF2Classic,代码行数:52,代码来源:tf_weaponbase_rocket.cpp


示例16: StopSound

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CPlayer_Missile::BlowUp(void)
{
	// Don't take damage any more
	m_takedamage	= DAMAGE_NO;

	// Mark as dead so won't be attacked
	m_lifeState = LIFE_DEAD;

	// Stop fly and launch sounds
	StopSound( "Player_Manhack.Fly" );
	StopSound( "Player_Manhack.Fire" );

	CPASFilter filter( GetAbsOrigin() );
	te->Explosion( filter, 0.0,
		&GetAbsOrigin(), 
		g_sModelIndexFireball,
		2.0, 
		15,
		TE_EXPLFLAG_NONE,
		m_flDamageRadius,
		m_flDamage );

	Vector vecForward = GetAbsVelocity();
	VectorNormalize(vecForward);
	trace_t		tr;
	UTIL_TraceLine ( GetAbsOrigin(), GetAbsOrigin() + 60*vecForward,  MASK_SOLID_BRUSHONLY, 
		this, COLLISION_GROUP_NONE, &tr);

	UTIL_DecalTrace( &tr, "Scorch" );

	UTIL_ScreenShake( GetAbsOrigin(), 25.0, 150.0, 1.0, 750, SHAKE_START );
	CSoundEnt::InsertSound ( SOUND_DANGER, GetAbsOrigin(), 1024, 3.0 );

	RadiusDamage ( CTakeDamageInfo( this, this, m_flDamage, DMG_BLAST ), GetAbsOrigin(), m_flDamageRadius, CLASS_NONE );

	SetThink(ExplodeThink);
	SetTouch(NULL);
	m_vBounceVel	= -0.2 * GetAbsVelocity();
	AddSolidFlags( FSOLID_NOT_SOLID );
	Relink();

	// Stop emitting smoke
	if(m_hSmokeTrail)
	{
		((SmokeTrail*)(CBaseEntity*)m_hSmokeTrail)->SetEmit(false);
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:50,代码来源:player_missile.cpp


示例17: EmitSound

void CBMortar::Touch( CBaseEntity *pOther )
{
	trace_t tr;
	int		iPitch;

	// splat sound
	iPitch = random->RandomFloat( 90, 110 );

	EmitSound( "NPC_BigMomma.SpitTouch1" );

	switch ( random->RandomInt( 0, 1 ) )
	{
	case 0:
		EmitSound( "NPC_BigMomma.SpitHit1" );
		break;
	case 1:
		EmitSound( "NPC_BigMomma.SpitHit2" );
		break;
	}

	if ( pOther->IsBSPModel() )
	{
		// make a splat on the wall
		UTIL_TraceLine( GetAbsOrigin(), GetAbsOrigin() + GetAbsVelocity() * 10, MASK_SOLID, this, COLLISION_GROUP_NONE, &tr );
		UTIL_DecalTrace( &tr, "Splash" );
	}
	else
	{
		tr.endpos = GetAbsOrigin();

		Vector vVelocity = GetAbsVelocity();
		VectorNormalize( vVelocity );

		tr.plane.normal = -1 * vVelocity;
	}
	// make some flecks
	MortarSpray( tr.endpos + Vector( 0, 0, 15 ), tr.plane.normal, gSpitSprite, 24 );

	CBaseEntity *pOwner = GetOwnerEntity();

	RadiusDamage( CTakeDamageInfo( this, pOwner, sk_bigmomma_dmg_blast.GetFloat(), DMG_ACID ), GetAbsOrigin(), sk_bigmomma_radius_blast.GetFloat(), CLASS_NONE, NULL );
		
	UTIL_Remove( pSprite );
	UTIL_Remove( this );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:45,代码来源:hl1_npc_bigmomma.cpp


示例18: UTIL_EmitAmbientSound

void CNihilanthHVR::ZapTouch( CBaseEntity *pOther )
{
	UTIL_EmitAmbientSound( edict(), pev->origin, "weapons/electro4.wav", 1.0, ATTN_NORM, 0, RANDOM_LONG( 90, 95 ) );

	RadiusDamage( pev, pev, 50, CLASS_NONE, DMG_SHOCK );
	pev->velocity = pev->velocity * 0;

	/*
	for (int i = 0; i < 10; i++)
	{
		Crawl( );
	}
	*/

	SetTouch( NULL );
	UTIL_Remove( this );
	pev->nextthink = gpGlobals->time + 0.2;
}
开发者ID:Fograin,项目名称:hl-subsmod-ex,代码行数:18,代码来源:monster_nihilanth.cpp


示例19: GetTimeDelta

void CWalkerMiniStrider::UpdateLargeGun()
{
	float dt = GetTimeDelta();

	if ( !m_bFiringLargeGun )
		return;

	m_flLargeGunCountdown -= dt;
	if ( m_flLargeGunCountdown <= 0 )
	{
		// Fire!
		Vector vSrc = GetLargeGunShootOrigin();
		trace_t trace;
		UTIL_TraceLine( vSrc, vSrc + m_vLargeGunForward * 2000, MASK_SOLID, this, COLLISION_GROUP_NONE, &trace );
		if ( trace.fraction < 1 )
		{
			CBasePlayer *pDriver = GetPassenger( VEHICLE_DRIVER );
			if ( pDriver )
			{
				UTIL_ImpactTrace( &trace, DMG_ENERGYBEAM, "Strider" );

				Vector vHitPos = trace.endpos;
				float flDamageRadius = 100;
				float flDamage = 100;

				CPASFilter filter( vHitPos );
				te->Explosion( filter, 0.0,
					&vHitPos, 
					g_sModelIndexFireball,
					2.0, 
					15,
					TE_EXPLFLAG_NONE,
					flDamageRadius,
					flDamage );

				UTIL_ScreenShake( vHitPos, 10.0, 150.0, 1.0, 100, SHAKE_START );
				RadiusDamage( CTakeDamageInfo( this, pDriver, flDamage, DMG_BLAST ), vHitPos, flDamageRadius, CLASS_NONE );
			}
		}

		StopFiringLargeGun();
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:43,代码来源:tf_walker_ministrider.cpp


示例20: SetModelName

	void CBaseGrenadeProjectile::Explode( trace_t *pTrace, int bitsDamageType )
	{
		SetModelName( NULL_STRING );//invisible
		AddSolidFlags( FSOLID_NOT_SOLID );

		m_takedamage = DAMAGE_NO;

		// Pull out of the wall a bit
		if ( pTrace->fraction != 1.0 )
		{
			SetAbsOrigin( pTrace->endpos + (pTrace->plane.normal * 0.6) );
		}

		Vector vecAbsOrigin = GetAbsOrigin();

		// Since this code only runs on the server, make sure it shows the tempents it creates.
		// This solves a problem with remote detonating the pipebombs (client wasn't seeing the explosion effect)
		CDisablePredictionFiltering disabler;

		DispatchParticleEffect("grenade_exp1", vecAbsOrigin, QAngle(0, 0, 0));

		CSoundEnt::InsertSound ( SOUND_COMBAT, vecAbsOrigin, BASEGRENADE_EXPLOSION_VOLUME, 3.0 );

		// Use the thrower's position as the reported position
		Vector vecReported = GetThrower() ? GetThrower()->GetAbsOrigin() : vec3_origin;
	
		CTakeDamageInfo info( this, GetThrower(), GetBlastForce(), vecAbsOrigin, m_flDamage, bitsDamageType, 0, &vecReported );

		RadiusDamage( info, vecAbsOrigin, m_DmgRadius, CLASS_NONE, NULL );

		UTIL_DecalTrace( pTrace, "Scorch" );

		EmitSound( "BaseGrenade.Explode" );

		SetThink( &CBaseGrenade::SUB_Remove );
		SetTouch( NULL );
		SetSolid( SOLID_NONE );
	
		AddEffects( EF_NODRAW );
		SetAbsVelocity( vec3_origin );

		SetNextThink( gpGlobals->curtime );
	}
开发者ID:theplaymate,项目名称:DoubleAction,代码行数:43,代码来源:sdk_basegrenade_projectile.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RageColor函数代码示例发布时间:2022-05-30
下一篇:
C++ Radius函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap