Esempio n. 1
0
int	AvHBite::GetIdleAnimation() const
{
	//int theBaseOffset = this->GetIsPlayerMoving() ? 5 : 2;
	//int theAnimation = theBaseOffset + UTIL_SharedRandomFloat(this->m_pPlayer->random_seed, 0, 1);

	// Must be odd
	int theAnimation = 0;
	const int kMax = 41;
	int theRandomNumber = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, kMax);

	if(theRandomNumber == kMax)
	{
		// Return flavor anim
		theAnimation = 2;
	} 
	else if(theRandomNumber < (kMax-1)/2)
	{
		theAnimation = 0;
	}
	else
	{
		theAnimation = 1;
	}

	return theAnimation;
}
Esempio n. 2
0
int	AvHGrenade::GetIdleAnimation() const
{
	int theAnim = -1;

	if( m_flStartThrow == 0 && m_flReleaseThrow == -1)
	{
		theAnim = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, 2);
	}

    return theAnim;
}
Esempio n. 3
0
int	AvHSonicGun::GetIdleAnimation() const
{
	int theAnimation = 0;

	int theRandomNum = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, 1);

	switch(theRandomNum)
	{
	case 0:
		theAnimation = kShotgunAnimIdle;
		break;
	case 1:
		theAnimation = kShotgunAnimIdle2;
		break;
	}
	
	return theAnimation;
}
Esempio n. 4
0
int	AvHBasePlayerWeapon::GetIdleAnimation() const
{
	int iAnim;
	int theRandomNum = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, 1);

	switch(theRandomNum)
	{
	case 0:	
		iAnim = kIdleAnimationOne;	
		break;
		
	default:
	case 1:
        iAnim = kIdleAnimationTwo;
		break;
	}

	return iAnim;
}
Esempio n. 5
0
int	AvHKnife::GetIdleAnimation() const
{
	// Only play the poking-finger animation once in awhile and play the knife flourish once in a blue moon, it's a special treat
	int iAnim;
	int theRandomNum = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, 200);

	if(theRandomNum == 0)
	{
		iAnim = 5;
	}
	else if(theRandomNum < 16)
	{
		iAnim = kIdleAnimationTwo;	
	}
	else
	{
		iAnim = kIdleAnimationOne;
	}

	return iAnim;
}
Esempio n. 6
0
int	AvHHeavyMachineGun::GetIdleAnimation() const
{
	const int kMaxRandom = 30;
	int iAnim;
	int theRandomNum = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, kMaxRandom);

	if(theRandomNum == 0)
	{
		// Pet machine gun every once in awhile
		iAnim = 1;
	}
	else if(theRandomNum < kMaxRandom/2)
	{
		iAnim = 0;
	}
	else
	{
		iAnim = 2;
	}
	
	return iAnim;
}
Esempio n. 7
0
int	AvHBlinkGun::GetIdleAnimation() const
{
	int theAnimation = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 17, 18);
	return theAnimation;
}
Esempio n. 8
0
/* <2cab36> ../cstrike/dlls/wpn_shared/wpn_xm1014.cpp:106 */
void CXM1014::__MAKE_VHOOK(PrimaryAttack)()
{
	Vector vecAiming, vecSrc, vecDir;
	int flag;

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

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

		if (TheBots != NULL)
		{
			TheBots->OnEvent(EVENT_WEAPON_FIRED_ON_EMPTY, m_pPlayer);
		}

		m_flNextPrimaryAttack = GetNextAttackDelay(1);
		return;
	}

	m_pPlayer->m_iWeaponVolume = LOUD_GUN_VOLUME;
	m_pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;
	m_iClip--;

	m_pPlayer->pev->effects |= EF_MUZZLEFLASH;
	// player "shoot" animation
	m_pPlayer->SetAnimation(PLAYER_ATTACK1);

	UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);

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

	m_pPlayer->FireBullets(6, vecSrc, vecAiming, XM1014_CONE_VECTOR, 3048, BULLET_PLAYER_BUCKSHOT, 0);

#ifdef CLIENT_WEAPONS
	flag = FEV_NOTHOST;
#else
	flag = 0;
#endif // CLIENT_WEAPONS

	PLAYBACK_EVENT_FULL(flag, m_pPlayer->edict(), m_usFireXM1014, 0, (float *)&g_vecZero, (float *)&g_vecZero, m_vVecAiming.x, m_vVecAiming.y, 7,
		(int)(m_vVecAiming.x * 100), m_iClip == 0, FALSE);

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

	if (m_iClip != 0)
		m_flPumpTime = UTIL_WeaponTimeBase() + 0.125f;

	m_flNextPrimaryAttack = GetNextAttackDelay(0.25);
	m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.25f;

	if (m_iClip != 0)
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.25f;
	else
		m_flTimeWeaponIdle = 0.75f;

	m_fInSpecialReload = 0;

	if (m_pPlayer->pev->flags & FL_ONGROUND)
		m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomLong(m_pPlayer->random_seed + 1, 3, 5);
	else
		m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomLong(m_pPlayer->random_seed + 1, 7, 10);
}
Esempio n. 9
0
void CM3::PrimaryAttack(void)
{
	if (m_pPlayer->pev->waterlevel == 3)
	{
		PlayEmptySound();
		m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.15;
		return;
	}

	if (m_iClip <= 0)
	{
		Reload();

		if (m_iClip == 0)
			PlayEmptySound();

		m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 1.0;
		return;
	}

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

	m_iClip--;
	m_pPlayer->pev->effects |= EF_MUZZLEFLASH;
#ifndef CLIENT_DLL
	m_pPlayer->SetAnimation(PLAYER_ATTACK1);
#endif

	UTIL_MakeVectors(m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle);
#ifndef CLIENT_DLL
	m_pPlayer->FireBullets(9, m_pPlayer->GetGunPosition(), gpGlobals->v_forward, Vector(0.0675, 0.0675, 0), 3000, BULLET_PLAYER_BUCKSHOT, 0);
#endif

	int flags;
#ifdef CLIENT_WEAPONS
	flags = FEV_NOTHOST;
#else
	flags = 0;
#endif

	PLAYBACK_EVENT_FULL(flags, ENT(m_pPlayer->pev), m_usFireM3, 0, (float *)&g_vecZero, (float *)&g_vecZero, 0, 0, 0, 0, FALSE, FALSE);

	if (m_iClip)
		m_flPumpTime = UTIL_WeaponTimeBase() + 0.5;

#ifndef CLIENT_DLL
	if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
		m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
#endif
	if (m_iClip)
		m_flPumpTime = UTIL_WeaponTimeBase() + 0.5;

	m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.875;
	m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.875;

	if (m_iClip)
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 2.5;
	else
		m_flTimeWeaponIdle = 0.875;

	m_fInSpecialReload = 0;

	if (m_pPlayer->pev->flags & FL_ONGROUND)
		m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomLong(m_pPlayer->random_seed + 1, 4, 6);
	else
		m_pPlayer->pev->punchangle.x -= UTIL_SharedRandomLong(m_pPlayer->random_seed + 1, 8, 11);

	m_pPlayer->m_flEjectBrass = gpGlobals->time + 0.45;
}
Esempio n. 10
0
int	AvHBabblerGun::GetIdleAnimation() const
{
	// Must be odd
	int theAnimation = UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, 1);
	return theAnimation;
}
Esempio n. 11
0
int	AvHKnife::GetShootAnimation() const
{
	// CS artwork
	//return 5 + UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, 2);
	return 2 + UTIL_SharedRandomLong(this->m_pPlayer->random_seed, 0, 1);
}