Exemplo n.º 1
0
void CMapLocation::UpdateLevelMap(CUICustomMap* map)
{
	CComplexMapSpot* csp = m_complex_spot;
	if ( csp && SpotEnabled() )
	{
		UpdateSpot(map, csp);
		return;
	}

	CMapSpot* sp = m_level_spot;
	if ( sp && SpotEnabled() )
	{
		UpdateSpot(map, sp);
	}
}
void CRpg::PrimaryAttack()
{
	if (m_iClip)
	{
		m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME;
		m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;

		m_iBody = 1; //hide rocket in laubcher
		SendWeaponAnim(RPG_FIRE);
		// player "shoot" animation
		m_pPlayer->SetAnimation(PLAYER_ATTACK1);

		UTIL_MakeVectors(m_pPlayer->pev->v_angle);
		Vector vecSrc = m_pPlayer->GetGunPosition() + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -8;

		CRpgRocket *pRocket = CRpgRocket::Create(vecSrc, m_pPlayer->pev->v_angle, m_pPlayer, this);
		UTIL_MakeVectors(m_pPlayer->pev->v_angle);// RpgRocket::Create stomps on globals, so remake.
		pRocket->pev->velocity = pRocket->pev->velocity + gpGlobals->v_forward * DotProduct(m_pPlayer->pev->velocity, gpGlobals->v_forward);

		// firing RPG no longer turns on the designator. ALT fire is a toggle switch for the LTD.
		// Ken signed up for this as a global change (sjb)

		m_iClip--;
		m_flNextPrimaryAttack = UTIL_GlobalTimeBase() + 1.5;
		m_flTimeWeaponIdle = UTIL_GlobalTimeBase() + 1.5;
	}
	else
	{
		PlayEmptySound();
		m_flNextPrimaryAttack = UTIL_GlobalTimeBase() + 0.7;//no longer indicate fps :)
	}
	UpdateSpot();
}
Exemplo n.º 3
0
void CTEST::WeaponIdle( void )
{
UpdateSpot( );

ResetEmptySound( );

m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES );

if (m_flTimeWeaponIdle > gpGlobals->time)
return;

int iAnim;
switch ( RANDOM_LONG( 0, 1 ) )
{
case 0:
iAnim = TEST_LONGIDLE;
break;

default:
case 1:
iAnim = TEST_IDLE1;
break;
}

SendWeaponAnim( iAnim );

m_flTimeWeaponIdle = gpGlobals->time + RANDOM_FLOAT ( 10, 15 );// how long till we do this again.
}
Exemplo n.º 4
0
void CMapLocation::UpdateMiniMap(CUICustomMap* map)
{
	CMapSpot* sp = m_minimap_spot;
	if(!sp) return;
	if(SpotEnabled())
		UpdateSpot(map, sp);

}
Exemplo n.º 5
0
void CRpg::WeaponIdle( void )
{
	UpdateSpot( );

	if ( m_flTimeWeaponIdle > gpGlobals->time)
		return;

	if (m_iClip)
		SendWeaponAnim( RPG_IDLE );
	else
		SendWeaponAnim( RPG_IDLE_EMPTY );
	m_flTimeWeaponIdle = gpGlobals->time + 8;
}
Exemplo n.º 6
0
void CTEST::PrimaryAttack()
{
// don''t fire underwater
if (m_pPlayer->pev->waterlevel == 3)
{
PlayEmptySound( );
m_flNextPrimaryAttack = gpGlobals->time + 0.15;
return;
}

if (m_iClip <= 0)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->time + 0.15;
return;
}

PLAYBACK_EVENT( 0, m_pPlayer->edict(), m_usTEST );

m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;

m_iClip--;

// player "shoot" animation
m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

Vector vecSrc = m_pPlayer->GetGunPosition( );
Vector vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES );

if ( g_pGameRules->IsDeathmatch() )
{
// optimized multiplayer. Widened to make it easier to hit a moving player
m_pPlayer->FireBullets( 1, vecSrc, vecAiming, VECTOR_CONE_6DEGREES, 8192, BULLET_PLAYER_MP5, 2 );
}
else
{
m_pPlayer->FireBullets( 1, vecSrc, vecAiming, VECTOR_CONE_3DEGREES, 8192, BULLET_PLAYER_MP5, 2 );
}

m_flNextPrimaryAttack = m_flNextPrimaryAttack + 0.1;
if (m_flNextPrimaryAttack < gpGlobals->time)
m_flNextPrimaryAttack = gpGlobals->time + 0.1;

m_flTimeWeaponIdle = gpGlobals->time + RANDOM_FLOAT ( 10, 15 );

UpdateSpot( );
}
Exemplo n.º 7
0
void CRpg::PrimaryAttack()
{
	if ( m_iClip )
	{
		m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME;
		m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;

#ifndef CLIENT_DLL
		// player "shoot" animation
		m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

		UTIL_MakeVectors( m_pPlayer->pev->v_angle );
		Vector vecSrc = m_pPlayer->GetGunPosition( ) + gpGlobals->v_forward * 16 + gpGlobals->v_right * 8 + gpGlobals->v_up * -8;
		
		CRpgRocket *pRocket = CRpgRocket::CreateRpgRocket( vecSrc, m_pPlayer->pev->v_angle, m_pPlayer, this );

		UTIL_MakeVectors( m_pPlayer->pev->v_angle );// RpgRocket::Create stomps on globals, so remake.
		pRocket->pev->velocity = pRocket->pev->velocity + gpGlobals->v_forward * DotProduct( m_pPlayer->pev->velocity, gpGlobals->v_forward );
#endif

		// firing RPG no longer turns on the designator. ALT fire is a toggle switch for the LTD.
		// Ken signed up for this as a global change (sjb)

		int flags;
#if defined( CLIENT_WEAPONS )
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

		PLAYBACK_EVENT( flags, m_pPlayer->edict(), m_usRpg );

		// Fograin92
		EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/rocketfire1.wav", 0.80, ATTN_NORM);

		m_iClip--; 
				
		m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.5;
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5;
	}
	else
	{
		PlayEmptySound( );
		m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2;
	}
	UpdateSpot( );
}
Exemplo n.º 8
0
void CUsas::WeaponIdle( void )
{
	UpdateSpot( );
	MakeLaserSight();

	ResetEmptySound( );

//	m_iFiring = FALSE;

//test
	
/*
	int flags;
#if defined( CLIENT_WEAPONS )
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	PLAYBACK_EVENT( flags, m_pPlayer->edict(), m_usSpriteTracer );
	ALERT (at_console, "calling spr\n");
*/
	m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES );

	if ( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() )
		return;

	int iAnim;
	switch ( RANDOM_LONG( 0, 1 ) )
	{
	case 0:	
		iAnim = USAS_IDLE1;	
		break;
	
	default:
	case 1:
		iAnim = USAS_IDLE1;
		break;
	}

	SendWeaponAnim( iAnim );

	m_flTimeWeaponIdle = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); // how long till we do this again.
}
Exemplo n.º 9
0
void CDeagle::WeaponIdle( void )
{
	UpdateSpot( );

	if (m_flTimeWeaponIdle <  UTIL_WeaponTimeBase() )
	{
		ResetEmptySound( );
		m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );

		// only idle if the slid isn't back
		if (m_iClip != 0)
		{
			int iAnim;
			float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0.0, 1.0 );

			if (flRand <= 0.3 + 0 * 0.75)
			{
				iAnim = DEAGLE_IDLE5;//Done
				m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 34.0 / 16.0;
			}
			else if (flRand <= 0.6 + 0 * 0.75)
			{
				iAnim = DEAGLE_IDLE4;//Done
				m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0;
			}
			else if (flRand <= 0.9 + 0 * 0.75)
			{
				iAnim = DEAGLE_IDLE1;//Done
				m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0;
			}
			else if (flRand <= 0.3 + 0 * 0.80)
			{
				iAnim = DEAGLE_IDLE2;
				m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0;
			}
			else
			{
				iAnim = DEAGLE_IDLE3;//Done
				m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 25.0 / 16;
			}
			SendWeaponAnim( iAnim, UseDecrement() ? 1 : 0 );
		}
	}
}
Exemplo n.º 10
0
void CRpg::PrimaryAttack()
{
	if (m_pPlayer->pev->waterlevel == 3 || m_iClip <= 0)
 	{
		PlayEmptySound( );
		m_flNextPrimaryAttack = gpGlobals->time + 0.5;
		return;
	}

	m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

	UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);
	CRpgRocket::ShootRpgRocket( m_pPlayer->pev, m_pPlayer->GetGunPosition( ) + gpGlobals->v_forward * 28 + gpGlobals->v_right * 8 + gpGlobals->v_up * -8, (m_pSpot)?gpGlobals->v_forward *250:gpGlobals->v_forward *2500, (m_pSpot)?TRUE:FALSE, this);
	FX_FireGun(m_pPlayer->pev->v_angle, m_pPlayer->entindex(), (m_pPlayer->m_fHeavyArmor)?RPG_FIRE_SOLID:RPG_FIRE, 0, FIREGUN_RPG );

	m_iClip--;
	m_flTimeWeaponIdle = gpGlobals->time + 5;
	m_flNextPrimaryAttack = gpGlobals->time + 1.5;
	if (!m_pPlayer->m_fHeavyArmor)
	m_pPlayer->pev->punchangle.x -= 11;
	UpdateSpot( );
}
Exemplo n.º 11
0
void CRpg::WeaponIdle( void )
{
	UpdateSpot( );

	ResetEmptySound( );

	if ( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() )
		return;

	if ( m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
	{
		int iAnim;
		float flRand = UTIL_SharedRandomFloat( m_pPlayer->random_seed, 0, 1 );
		if (flRand <= 0.75 || m_fSpotActive)
		{
			if ( m_iClip == 0 )
				iAnim = RPG_IDLE_UL;
			else
				iAnim = RPG_IDLE;

			m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 90.0 / 15.0;
		}
		else
		{
			if ( m_iClip == 0 )
				iAnim = RPG_FIDGET_UL;
			else
				iAnim = RPG_FIDGET;

			m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0;
		}

		SendWeaponAnim( iAnim );
	}
	else
	{
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1;
	}
}
void CRpg::WeaponIdle(void)
{
	UpdateSpot();

	if (m_flTimeWeaponIdle > UTIL_GlobalTimeBase()) return;

	if (m_iClip && !m_iOverloadLevel)
	{
		int iAnim;
		float flRand = RANDOM_FLOAT(0, 1);
		if (flRand <= 0.75)
		{
			iAnim = RPG_IDLE;
			m_flTimeWeaponIdle = UTIL_GlobalTimeBase() + 6.3;
		}
		else
		{
			iAnim = RPG_IDLE2;
			m_flTimeWeaponIdle = UTIL_GlobalTimeBase() + 6.3;
		}
		SendWeaponAnim(iAnim);
	}
}
Exemplo n.º 13
0
void CUsas::PrimaryAttack()
{
	// don't fire underwater
	if (m_pPlayer->pev->waterlevel == 3)
	{
		PlayEmptySound( );
		m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15;
		return;
	}

	if (m_iClip <= 0)
	{
		Reload( );
		if (m_iClip == 0)
			PlayEmptySound( );
		return;
	}

	m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME;
	m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;

	m_iClip--;

	int flags;
#if defined( CLIENT_WEAPONS )
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif


	m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;

	// player "shoot" animation
    m_pPlayer->SetAnimation( PLAYER_ATTACK1 );

	Vector vecSrc	 = m_pPlayer->GetGunPosition( );
	Vector vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_5DEGREES );

	Vector vecDir;

#ifdef CLIENT_DLL
	if ( bIsMultiplayer() )
#else
	if ( g_pGameRules->IsMultiplayer() )
#endif
	{
		vecDir = m_pPlayer->FireBulletsPlayer( 4, vecSrc, vecAiming, VECTOR_CONE_DM_SHOTGUN, 2048, BULLET_PLAYER_USAS, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
	}
	else
	{
		// regular old, untouched spread. 
		vecDir = m_pPlayer->FireBulletsPlayer( 6, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_USAS, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
	}

	PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usFireUsas, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 );

	if (m_iClip != 0)
		m_flPumpTime = gpGlobals->time + 0.5;

	m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; //() + 0.75;
	m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25;
	if (m_iClip != 0)
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 5.0;
	else
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.75;
	m_fInSpecialReload = 0;
	UpdateSpot( );
}
Exemplo n.º 14
0
void CTEST::Reload( void )
{
UpdateSpot( );
DefaultReload( TEST_MAX_CLIP, TEST_RELOAD, 1.5 );
}
Exemplo n.º 15
0
void CDeagle::PrimaryAttack()
{
	if (m_iClip <= 0)
	{
		if (m_fFireOnEmpty)
		{
			PlayEmptySound();
			m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.2;
		}

		return;
	}

	// don't fire underwater
	if (m_pPlayer->pev->waterlevel == 3)
	{
		UpdateSpot( );
		PlayEmptySound( );
		m_flNextPrimaryAttack = 0.15;
		return;
	}

	UpdateSpot( );

	float flSpread = 0.01;

	m_iClip--;

	m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;

	int flags;
	BOOL m_fLaserOn;

#if defined( CLIENT_WEAPONS )
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	// player "shoot" animation
	m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
	m_pPlayer->m_iWeaponVolume = NORMAL_GUN_VOLUME;
	m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;

	Vector vecSrc	 = m_pPlayer->GetGunPosition( );
	Vector vecAiming;
	vecAiming = gpGlobals->v_forward;

	Vector vecDir;
	if (m_pEagleLaser)
	{
		vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector( flSpread, flSpread, flSpread ), 8192, BULLET_PLAYER_DEAGLE, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
		m_flNextPrimaryAttack = 0.50;
		m_pEagleLaser->Suspend( 0.75 );
		m_fLaserOn = TRUE;
	}
	else
	{
		flSpread = 0.1;
		vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 8192, BULLET_PLAYER_DEAGLE, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
		m_flNextPrimaryAttack = 0.20;
		m_fLaserOn = FALSE;
	}

	PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEagle, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, flSpread, flSpread, ( m_iClip == 0 ) ? 1 : 0, 0 );

	// Fograin92
	EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/desert_eagle_fire.wav", 0.80, ATTN_NORM);

	if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
	// HEV suit - indicate out of ammo condition
	m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);

	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
}