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


C++ RadiusDamage函数代码示例

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


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


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