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(); }
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 ); }