コード例 #1
0
ファイル: weapons.c プロジェクト: stayoutEE/qwprogs-qvm
void GrenadeTouch()
{
	if ( other == PROG_TO_EDICT( self->s.v.owner ) )
		return;		// don't explode on owner
	if ( other->s.v.takedamage == DAMAGE_AIM )
	{
		GrenadeExplode();
		return;
	}
	sound( self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM );	// bounce sound
	if ( self->s.v.velocity[0] == 0 && self->s.v.velocity[1] == 0
	     && self->s.v.velocity[2] == 0 )
		VectorClear( self->s.v.avelocity );
}
コード例 #2
0
ファイル: quake_rocket.cpp プロジェクト: CecilHarvey/RealBot
//=========================================================
void CQuakeRocket::GrenadeTouch( CBaseEntity *pOther )
{
	if (pOther->pev->takedamage == DAMAGE_AIM)
	{
		GrenadeExplode();
		return;
	}

	if (pev->flags & FL_ONGROUND)
		{
			// add a bit of static friction
			pev->velocity = pev->velocity * 0.75;

			if (pev->velocity.Length() <= 20)
			{
				pev->avelocity = g_vecZero;
			}
		}

	EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM);

	if (pev->velocity == g_vecZero)
		pev->avelocity = g_vecZero;
}