本文整理汇总了C++中CCSPlayer::EyeAngles方法的典型用法代码示例。如果您正苦于以下问题:C++ CCSPlayer::EyeAngles方法的具体用法?C++ CCSPlayer::EyeAngles怎么用?C++ CCSPlayer::EyeAngles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCSPlayer
的用法示例。
在下文中一共展示了CCSPlayer::EyeAngles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ELITEFire
void CWeaponElite::ELITEFire( float flSpread )
{
CCSPlayer *pPlayer = GetPlayerOwner();
if ( !pPlayer )
return;
pPlayer->m_iShotsFired++;
if (pPlayer->m_iShotsFired > 1)
return;
// Mark the time of this shot and determine the accuracy modifier based on the last shot fired...
m_flAccuracy -= (0.275)*(0.325 - (gpGlobals->curtime - m_flLastFire));
if (m_flAccuracy > 0.88)
m_flAccuracy = 0.88;
else if (m_flAccuracy < 0.55)
m_flAccuracy = 0.55;
m_flLastFire = gpGlobals->curtime;
if (m_iClip1 <= 0)
{
if (m_bFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
}
return;
}
m_iClip1--;
m_bFireRight = !m_bFireRight; // flip side
pPlayer->DoMuzzleFlash();
//SetPlayerShieldAnim();
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );
FX_FireBullets(
pPlayer->entindex(),
pPlayer->Weapon_ShootPosition(),
pPlayer->EyeAngles() + 2.0f * pPlayer->GetPunchAngle(),
GetWeaponID(),
m_bFireRight?Primary_Mode:Secondary_Mode,
CBaseEntity::GetPredictionRandomSeed() & 255,
flSpread );
m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime + GetCSWpnData().m_flCycleTime;
if (!m_iClip1 && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) <= 0)
{
// HEV suit - indicate out of ammo condition
pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
}
SetWeaponIdleTime( gpGlobals->curtime + 2.5 );
if ( m_bFireRight ) //even number
{
if ( m_iClip1 > 1 )
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
else
SendWeaponAnim( ACT_VM_DRYFIRE_LEFT );
}
else
{
if ( m_iClip1 > 0 )
SendWeaponAnim( ACT_VM_SECONDARYATTACK );
else
SendWeaponAnim( ACT_VM_DRYFIRE );
}
QAngle punchAngle = pPlayer->GetPunchAngle();
punchAngle.x -= 2;
pPlayer->SetPunchAngle( punchAngle );
//ResetPlayerShieldAnim();
}
示例2: DEAGLEFire
void CDEagle::DEAGLEFire( float flSpread, float flCycleTime, bool fUseSemi )
{
CCSPlayer *pPlayer = GetPlayerOwner();
flCycleTime -= 0.075;
m_iShotsFired++;
if (m_iShotsFired > 1)
return;
// Mark the time of this shot and determine the accuracy modifier based on the last shot fired...
if ( m_flLastFire == 0 )
{
m_flLastFire = gpGlobals->curtime;
}
else
{
m_flAccuracy -= (0.35)*(0.4 - ( gpGlobals->curtime - m_flLastFire ) );
if (m_flAccuracy > 0.9)
m_flAccuracy = 0.9;
else if (m_flAccuracy < 0.55)
m_flAccuracy = 0.55;
m_flLastFire = gpGlobals->curtime;
}
if (m_iClip1 <= 0)
{
if (m_bFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
}
return;
}
m_iClip1--;
pPlayer->m_fEffects |= EF_MUZZLEFLASH;
//SetPlayerShieldAnim();
// player "shoot" animation
//m_pPlayer->SetAnimation( PLAYER_ATTACK1 );
//pPlayer->m_iWeaponVolume = BIG_EXPLOSION_VOLUME;
//pPlayer->m_iWeaponFlash = BRIGHT_GUN_FLASH;
Vector vecSrc = pPlayer->Weapon_ShootPosition();
Vector vecDir = pPlayer->FireBullets3(
vecSrc,
pPlayer->EyeAngles() + pPlayer->GetPunchAngle(),
flSpread,
4096,
2,
GetPrimaryAmmoType(),
54,
0.81,
pPlayer );
WeaponSound( SINGLE );
/*
#if defined( CLIENT_WEAPONS )
int flag = FEV_NOTHOST;
#else
int flag = 0;
#endif
PLAYBACK_EVENT_FULL( flag, m_pPlayer->edict(), m_usFireDeagle,
0.0, (float *)&g_vecZero, (float *)&g_vecZero,
vecDir.x,
vecDir.y,
m_pPlayer->pev->punchangle.x * 100,
m_pPlayer->pev->punchangle.y * 100,
m_iClip1 ? 0 : 1, 0 );
*/
m_flNextPrimaryAttack = gpGlobals->curtime + flCycleTime;
if ( !m_iClip1 && pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0 )
{
// HEV suit - indicate out of ammo condition
pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
}
m_flTimeWeaponIdle = gpGlobals->curtime + 1.8;
QAngle punchAngle = pPlayer->GetPunchAngle();
punchAngle.x -= 2;
pPlayer->SetPunchAngle( punchAngle );
//ResetPlayerShieldAnim();
}
示例3: CSBaseGunFire
bool CWeaponCSBaseGun::CSBaseGunFire( float flSpread, float flCycleTime, bool bPrimaryMode )
{
CCSPlayer *pPlayer = GetPlayerOwner();
if ( !pPlayer )
return false;
const CCSWeaponInfo &pCSInfo = GetCSWpnData();
m_bDelayFire = true;
pPlayer->m_iShotsFired++;
// These modifications feed back into flSpread eventually.
if ( pCSInfo.m_flAccuracyDivisor != -1 )
{
int iShotsFired = pPlayer->m_iShotsFired;
if ( pCSInfo.m_bAccuracyQuadratic )
iShotsFired = iShotsFired * iShotsFired;
else
iShotsFired = iShotsFired * iShotsFired * iShotsFired;
m_flAccuracy = ( iShotsFired / pCSInfo.m_flAccuracyDivisor) + pCSInfo.m_flAccuracyOffset;
if (m_flAccuracy > pCSInfo.m_flMaxInaccuracy)
m_flAccuracy = pCSInfo.m_flMaxInaccuracy;
}
// Out of ammo?
if ( m_iClip1 <= 0 )
{
if (m_bFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
}
return false;
}
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
m_iClip1--;
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );
FX_FireBullets(
pPlayer->entindex(),
pPlayer->Weapon_ShootPosition(),
pPlayer->EyeAngles() + 2.0f * pPlayer->GetPunchAngle(),
GetWeaponID(),
bPrimaryMode?Primary_Mode:Secondary_Mode,
CBaseEntity::GetPredictionRandomSeed() & 255,
flSpread );
DoFireEffects();
m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime + flCycleTime;
if (!m_iClip1 && pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) <= 0)
{
// HEV suit - indicate out of ammo condition
pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
}
SetWeaponIdleTime( gpGlobals->curtime + pCSInfo.m_flTimeToIdleAfterFire );
return true;
}
示例4: USPFire
void CWeaponUSP::USPFire( float flSpread, float flCycleTime, bool fUseSemi )
{
CCSPlayer *pPlayer = GetPlayerOwner();
flCycleTime -= 0.075;
m_iShotsFired++;
if (m_iShotsFired > 1)
return;
// Mark the time of this shot and determine the accuracy modifier based on the last shot fired...
if (m_flLastFire == 0)
m_flLastFire = gpGlobals->curtime;
else
{
m_flAccuracy -= (0.275)*(0.3 - (gpGlobals->curtime - m_flLastFire));
if (m_flAccuracy > 0.92)
m_flAccuracy = 0.92;
else if (m_flAccuracy < 0.6)
m_flAccuracy = 0.6;
m_flLastFire = gpGlobals->curtime;
}
if (m_iClip1 <= 0)
{
if (m_bFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
}
return;
}
m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime + flCycleTime;
m_iClip1--;
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );
int damageAmt;
if ( m_bSilencerOn )
{
WeaponSound( SPECIAL1 );
damageAmt = 30;
}
else
{
WeaponSound( SINGLE );
damageAmt = 34;
pPlayer->m_fEffects |= EF_MUZZLEFLASH;
}
Vector vecDir = pPlayer->FireBullets3(
pPlayer->Weapon_ShootPosition(),
pPlayer->EyeAngles() + pPlayer->GetPunchAngle(),
flSpread,
4096,
1,
GetPrimaryAmmoType(),
damageAmt,
0.79,
pPlayer );
/*
pPlayer->m_iWeaponVolume = BIG_EXPLOSION_VOLUME;
pPlayer->m_iWeaponFlash = DIM_GUN_FLASH;
int flag;
#if defined( CLIENT_WEAPONS )
flag = FEV_NOTHOST;
#else
flag = 0;
#endif
PLAYBACK_EVENT_FULL( flag, pPlayer->edict(), m_usFireUSP,
0.0, (float *)&g_vecZero, (float *)&g_vecZero,
vecDir.x,
vecDir.y,
pPlayer->pev->punchangle.x * 100, 0, m_iClip1 ? 0 : 1, (m_iWeaponState & WPNSTATE_USP_SILENCER_ON) ? 1 : 0 );
*/
if (!m_iClip1 && pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0)
{
// HEV suit - indicate out of ammo condition
pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
}
m_flTimeWeaponIdle = gpGlobals->curtime + 2;
QAngle angle = pPlayer->GetPunchAngle();
angle.x -= 2;
pPlayer->SetPunchAngle( angle );
}
示例5: USPFire
void CWeaponUSP::USPFire( float flSpread )
{
CCSPlayer *pPlayer = GetPlayerOwner();
if ( !pPlayer )
return;
float flCycleTime = GetCSWpnData().m_flCycleTime;
pPlayer->m_iShotsFired++;
if (pPlayer->m_iShotsFired > 1)
return;
// Mark the time of this shot and determine the accuracy modifier based on the last shot fired...
m_flAccuracy -= (0.275)*(0.3 - (gpGlobals->curtime - m_flLastFire));
if (m_flAccuracy > 0.92)
m_flAccuracy = 0.92;
else if (m_flAccuracy < 0.6)
m_flAccuracy = 0.6;
m_flLastFire = gpGlobals->curtime;
if (m_iClip1 <= 0)
{
if (m_bFireOnEmpty)
{
PlayEmptySound();
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
}
return;
}
m_flNextPrimaryAttack = m_flNextSecondaryAttack = gpGlobals->curtime + flCycleTime;
m_iClip1--;
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
// player "shoot" animation
pPlayer->SetAnimation( PLAYER_ATTACK1 );
if ( !m_bSilencerOn )
{
pPlayer->DoMuzzleFlash();
}
FX_FireBullets(
pPlayer->entindex(),
pPlayer->Weapon_ShootPosition(),
pPlayer->EyeAngles() + 2.0f * pPlayer->GetPunchAngle(),
GetWeaponID(),
m_bSilencerOn?Secondary_Mode:Primary_Mode,
CBaseEntity::GetPredictionRandomSeed() & 255,
flSpread );
if (!m_iClip1 && pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0)
{
// HEV suit - indicate out of ammo condition
pPlayer->SetSuitUpdate("!HEV_AMO0", false, 0);
}
SetWeaponIdleTime( gpGlobals->curtime + 2 );
QAngle angle = pPlayer->GetPunchAngle();
angle.x -= 2;
pPlayer->SetPunchAngle( angle );
}