Пример #1
0
void CHelicopter::OnShot		()
{
	Fvector fire_pos,fire_dir;
	fire_pos = get_CurrentFirePoint();
	fire_dir = m_fire_dir;

	float fire_trail_speed		= 15.0f;
	clamp						(fire_trail_speed,GetCurrVelocity(),300.0f);
	if(m_enemy.bUseFireTrail){
		Fvector enemy_pos = m_enemy.destEnemyPos;

		float	dt		= Device.fTimeGlobal - m_enemy.fStartFireTime; VERIFY(dt>=0);
		float	dist	= m_enemy.fire_trail_length_curr - dt*fire_trail_speed;
		if(dist<0)
		{
			MGunFireEnd	();
			return		;
		}

		Fvector fp		= fire_pos;
		fp.y			= enemy_pos.y;
		Fvector	fd;
		fd.sub(enemy_pos,fp).normalize_safe();
		if(dist > (m_enemy.fire_trail_length_curr/2.0f) ){
			fd.mul(-1.0f);
			dist = dist - (m_enemy.fire_trail_length_curr/2.0f);
		}else{
			dist = (m_enemy.fire_trail_length_curr/2.0f) - dist;
		}
		

		static float fire_trace_width = pSettings->r_float(*cNameSect(),"fire_trace_width");
		enemy_pos.mad(fd,dist);
		Fvector disp_dir;
		disp_dir.random_point(fire_trace_width);

		enemy_pos.add(disp_dir);
		fire_dir.sub(enemy_pos,fire_pos).normalize_safe();
	};

	FireBullet(fire_pos, fire_dir, fireDispersionBase, m_CurrentAmmo, ID(), ID(), OnServer());

	StartShotParticles	();
	if(m_bLightShotEnabled) 
		Light_Start			();


	StartFlameParticles		();
	StartSmokeParticles		(fire_pos, zero_vel);
	OnShellDrop				(fire_pos, zero_vel);

	HUD_SOUND_ITEM::PlaySound	(m_sndShot, fire_pos, this, false);

}
Пример #2
0
void CCarWeapon::OnShot()
{
	FireBullet				(	m_fire_pos, m_fire_dir, fireDispersionBase, *m_Ammo, 
								m_object->ID(), m_object->ID(), SendHitAllowed(m_object));

	StartShotParticles		();
	
	if(m_bLightShotEnabled) 
		Light_Start			();

	StartFlameParticles		();
	StartSmokeParticles		(m_fire_pos, zero_vel);
//	OnShellDrop				(m_fire_pos, zero_vel);

	HUD_SOUND::PlaySound	(m_sndShot, m_fire_pos, m_object, false);
}
Пример #3
0
void CWeaponPistol::OnShot		()
{
	PlaySound		(m_sSndShotCurrent.c_str(),get_LastFP());

	AddShotEffector	();
	
	PlayAnimShoot	();

	// Shell Drop
	Fvector vel; 
	PHGetLinearVell(vel);
	OnShellDrop					(get_LastSP(),  vel);

	// ќгонь из ствола
	
	StartFlameParticles	();
	R_ASSERT2(!m_pFlameParticles || !m_pFlameParticles->IsLooped(),
			  "can't set looped particles system for shoting with pistol");
	
	//дым из ствола
	StartSmokeParticles	(get_LastFP(), vel);
}
Пример #4
0
void CWeaponMagazined::OnShot()
{
	// Sound
	PlaySound(*m_pSndShotCurrent, get_LastFP());

	// Camera
	AddShotEffector();

	// Animation
	PlayAnimShoot();

	// Shell Drop
	Fvector vel;
	PHGetLinearVell(vel);
	OnShellDrop(get_LastSP(), vel);

	// Огонь из ствола
	StartFlameParticles();

	//дым из ствола
	ForceUpdateFireParticles();
	StartSmokeParticles(get_LastFP(), vel);
}
Пример #5
0
void CWeaponStatMgun::OnShot()
{
	VERIFY(Owner());

	FireBullet				(	m_fire_pos, m_fire_dir, fireDispersionBase, *m_Ammo, 
								Owner()->ID(),ID(), SendHitAllowed(Owner()));

	StartShotParticles		();
	
	if(m_bLightShotEnabled) 
		Light_Start			();

	StartFlameParticles		();
	StartSmokeParticles		(m_fire_pos, zero_vel);
	OnShellDrop				(m_fire_pos, zero_vel);

	bool b_hud_mode =		(Level().CurrentEntity() == smart_cast<CObject*>(Owner()));
	m_sounds.PlaySound		("sndShot", m_fire_pos, Owner(), b_hud_mode);

	AddShotEffector			();
	m_dAngle.set			(	::Random.randF(-fireDispersionBase,fireDispersionBase),
								::Random.randF(-fireDispersionBase,fireDispersionBase));
}