Example #1
0
CBMortar *CBMortar::Shoot( edict_t *pOwner, Vector vecStart, Vector vecVelocity )
{
	CBMortar *pSpit = GetClassPtr( (CBMortar *)NULL );
	pSpit->Spawn();
	
	UTIL_SetOrigin( pSpit->pev, vecStart );
	pSpit->pev->velocity = vecVelocity;
	pSpit->pev->owner = pOwner;
	pSpit->pev->scale = 2.5;
	pSpit->SetThink ( Animate );
	pSpit->pev->nextthink = gpGlobals->time + 0.1;

	return pSpit;
}
void CNPC_BigMomma::LaunchMortar( void )
{
	m_mortarTime = gpGlobals->curtime + RandomFloat( 2, 15 );
	
	Vector startPos = GetAbsOrigin();
	startPos.z += 180;

	CPASAttenuationFilter filter( this );
	EmitSound( filter, entindex(), "BigMomma.LaunchMortar" );

	CBMortar *pBomb = CBMortar::Shoot( this, startPos, m_vTossDir );
	pBomb->SetGravity( 1.0 );
	MortarSpray( startPos, Vector(0,0,10), gSpitSprite, 24 );
}
Example #3
0
CBMortar *CBMortar::Shoot( edict_t *pOwner, Vector vecStart, Vector vecVelocity )
{
	CBMortar *pSpit = GetClassPtr( (CBMortar *)NULL );
	pSpit->Spawn();
	
	UTIL_SetOrigin( pSpit, vecStart );
	pSpit->pev->velocity = vecVelocity;
	pSpit->pev->owner = pOwner;
	pSpit->pev->scale = 2.5;
	pSpit->SetThink(&CBMortar:: Animate );
	pSpit->SetNextThink( 0.1 );

	return pSpit;
}
CBMortar *CBMortar::Shoot( CBaseEntity *pOwner, Vector vecStart, Vector vecVelocity )
{
	CBMortar *pSpit = CREATE_ENTITY( CBMortar, "bmortar" ); 
	pSpit->Spawn();
	
	UTIL_SetOrigin( pSpit, vecStart );
	pSpit->SetAbsVelocity( vecVelocity );
	pSpit->SetOwnerEntity( pOwner );
	pSpit->SetThink ( &CBMortar::Animate );
	pSpit->SetNextThink( gpGlobals->curtime + 0.1 );

	return pSpit;
}