Browse Source

Update desert eagle

opforfixed
Roman Chistokhodov 5 years ago
parent
commit
865ea98475
  1. 4
      cl_dll/ev_hldm.cpp
  2. 2
      cl_dll/ev_hldm.h
  3. 5
      dlls/combat.cpp
  4. 36
      dlls/gearbox/eagle.cpp
  5. 2
      dlls/gearbox/massn.cpp
  6. 1
      dlls/weapons.cpp
  7. 2
      dlls/weapons.h

4
cl_dll/ev_hldm.cpp

@ -327,6 +327,7 @@ void EV_HLDM_DecalGunshot( pmtrace_t *pTrace, int iBulletType )
case BULLET_MONSTER_MP5: case BULLET_MONSTER_MP5:
case BULLET_PLAYER_BUCKSHOT: case BULLET_PLAYER_BUCKSHOT:
case BULLET_PLAYER_357: case BULLET_PLAYER_357:
case BULLET_PLAYER_EAGLE:
case BULLET_MONSTER_357: case BULLET_MONSTER_357:
case BULLET_PLAYER_556: case BULLET_PLAYER_556:
case BULLET_MONSTER_556: case BULLET_MONSTER_556:
@ -467,6 +468,7 @@ void EV_HLDM_FireBullets( int idx, float *forward, float *right, float *up, int
EV_HLDM_DecalGunshot( &tr, iBulletType ); EV_HLDM_DecalGunshot( &tr, iBulletType );
break; break;
case BULLET_PLAYER_357: case BULLET_PLAYER_357:
case BULLET_PLAYER_EAGLE:
EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType ); EV_HLDM_PlayTextureSound( idx, &tr, vecSrc, vecEnd, iBulletType );
EV_HLDM_DecalGunshot( &tr, iBulletType ); EV_HLDM_DecalGunshot( &tr, iBulletType );
break; break;
@ -1903,7 +1905,7 @@ void EV_FireEagle( event_args_t *args )
VectorCopy( forward, vecAiming ); VectorCopy( forward, vecAiming );
EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_357, 0, 0, args->fparam1, args->fparam2 ); EV_HLDM_FireBullets( idx, forward, right, up, 1, vecSrc, vecAiming, 8192, BULLET_PLAYER_EAGLE, 0, 0, args->fparam1, args->fparam2 );
} }
//====================== //======================
// DESERT EAGLE END // DESERT EAGLE END

2
cl_dll/ev_hldm.h

@ -20,6 +20,8 @@ typedef enum
BULLET_PLAYER_CROWBAR, // crowbar swipe BULLET_PLAYER_CROWBAR, // crowbar swipe
BULLET_PLAYER_556, BULLET_PLAYER_556,
BULLET_PLAYER_762, BULLET_PLAYER_762,
BULLET_PLAYER_EAGLE,
BULLET_MONSTER_9MM, BULLET_MONSTER_9MM,
BULLET_MONSTER_MP5, BULLET_MONSTER_MP5,
BULLET_MONSTER_12MM, BULLET_MONSTER_12MM,

5
dlls/combat.cpp

@ -1453,7 +1453,7 @@ void CBaseEntity::FireBullets( ULONG cShots, Vector vecSrc, Vector vecDirShootin
} }
break; break;
case BULLET_MONSTER_357: case BULLET_MONSTER_357:
pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357, vecDir, &tr, DMG_BULLET ); pEntity->TraceAttack( pevAttacker, gSkillData.plrDmgEagle, vecDir, &tr, DMG_BULLET );
TEXTURETYPE_PlaySound( &tr, vecSrc, vecEnd, iBulletType ); TEXTURETYPE_PlaySound( &tr, vecSrc, vecEnd, iBulletType );
DecalGunshot( &tr, iBulletType ); DecalGunshot( &tr, iBulletType );
break; break;
@ -1553,6 +1553,9 @@ Vector CBaseEntity::FireBulletsPlayer( ULONG cShots, Vector vecSrc, Vector vecDi
case BULLET_PLAYER_357: case BULLET_PLAYER_357:
pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357, vecDir, &tr, DMG_BULLET ); pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg357, vecDir, &tr, DMG_BULLET );
break; break;
case BULLET_PLAYER_EAGLE:
pEntity->TraceAttack( pevAttacker, gSkillData.plrDmgEagle, vecDir, &tr, DMG_BULLET );
break;
case BULLET_PLAYER_556: case BULLET_PLAYER_556:
pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg556, vecDir, &tr, DMG_BULLET ); pEntity->TraceAttack( pevAttacker, gSkillData.plrDmg556, vecDir, &tr, DMG_BULLET );
break; break;

36
dlls/gearbox/eagle.cpp

@ -35,13 +35,13 @@ LINK_ENTITY_TO_CLASS( eagle_laser, CLaserSpot )
void CEagle::Spawn( void ) void CEagle::Spawn( void )
{ {
pev->classname = MAKE_STRING("weapon_eagle"); // hack to allow for old names
Precache( ); Precache( );
m_iId = WEAPON_EAGLE; m_iId = WEAPON_EAGLE;
SET_MODEL(ENT(pev), "models/w_desert_eagle.mdl"); SET_MODEL(ENT(pev), "models/w_desert_eagle.mdl");
m_iDefaultAmmo = EAGLE_DEFAULT_GIVE; m_iDefaultAmmo = EAGLE_DEFAULT_GIVE;
m_fEagleLaserActive = 0;
m_pEagleLaser = 0;
FallInit();// get ready to fall down. FallInit();// get ready to fall down.
} }
@ -102,16 +102,18 @@ void CEagle::SecondaryAttack()
{ {
bool wasActive = m_fEagleLaserActive; bool wasActive = m_fEagleLaserActive;
m_fEagleLaserActive = !m_fEagleLaserActive; m_fEagleLaserActive = !m_fEagleLaserActive;
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5;
if (wasActive) if (wasActive)
{ {
#ifndef CLIENT_DLL
if (m_pEagleLaser) if (m_pEagleLaser)
{ {
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/desert_eagle_sight2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM); EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/desert_eagle_sight2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM);
m_pEagleLaser->Killed( NULL, GIB_NORMAL ); m_pEagleLaser->Killed( NULL, GIB_NORMAL );
m_pEagleLaser = NULL; m_pEagleLaser = NULL;
} }
#endif
} }
m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.5;
} }
void CEagle::PrimaryAttack() void CEagle::PrimaryAttack()
@ -144,7 +146,6 @@ void CEagle::PrimaryAttack()
m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH; m_pPlayer->pev->effects = (int)(m_pPlayer->pev->effects) | EF_MUZZLEFLASH;
int flags; int flags;
BOOL m_fLaserOn;
#if defined( CLIENT_WEAPONS ) #if defined( CLIENT_WEAPONS )
flags = FEV_NOTHOST; flags = FEV_NOTHOST;
@ -158,32 +159,29 @@ void CEagle::PrimaryAttack()
m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH; m_pPlayer->m_iWeaponFlash = NORMAL_GUN_FLASH;
Vector vecSrc = m_pPlayer->GetGunPosition( ); Vector vecSrc = m_pPlayer->GetGunPosition( );
Vector vecAiming; Vector vecAiming = m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );
vecAiming = gpGlobals->v_forward;
Vector vecDir; Vector vecDir;
if (m_fEagleLaserActive) if (m_fEagleLaserActive)
{ {
vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector( flSpread, flSpread, flSpread ), 8192, BULLET_PLAYER_357, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed ); vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector( flSpread, flSpread, flSpread ), 8192, BULLET_PLAYER_EAGLE, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
m_flNextPrimaryAttack = UTIL_WeaponTimeBase()+ 0.5; m_flNextPrimaryAttack = UTIL_WeaponTimeBase()+ 0.5;
#ifndef CLIENT_DLL #ifndef CLIENT_DLL
m_pEagleLaser->Suspend( 0.6 ); m_pEagleLaser->Suspend( 0.6 );
#endif #endif
m_fLaserOn = TRUE;
} }
else else
{ {
flSpread = 0.1; flSpread = 0.1;
vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector(flSpread, flSpread, flSpread), 8192, BULLET_PLAYER_357, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed ); vecDir = m_pPlayer->FireBulletsPlayer( 1, vecSrc, vecAiming, Vector(flSpread, flSpread, flSpread), 8192, BULLET_PLAYER_EAGLE, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
m_flNextPrimaryAttack = UTIL_WeaponTimeBase()+ 0.22; m_flNextPrimaryAttack = UTIL_WeaponTimeBase()+ 0.22;
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 ); PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usEagle, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 );
if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0) if (!m_iClip && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
// HEV suit - indicate out of ammo condition // HEV suit - indicate out of ammo condition
m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0); m_pPlayer->SetSuitUpdate("!HEV_AMO0", FALSE, 0);
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 ); m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat( m_pPlayer->random_seed, 10, 15 );
} }
@ -192,7 +190,10 @@ void CEagle::PrimaryAttack()
void CEagle::Reload( void ) void CEagle::Reload( void )
{ {
if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == EAGLE_MAX_CLIP) if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == EAGLE_MAX_CLIP)
return; {
UpdateSpot();
return;
}
if ( m_pEagleLaser && m_fEagleLaserActive ) if ( m_pEagleLaser && m_fEagleLaserActive )
{ {
@ -245,11 +246,12 @@ void CEagle::WeaponIdle( void )
{ {
UpdateSpot( ); UpdateSpot( );
if (m_flTimeWeaponIdle < UTIL_WeaponTimeBase() ) ResetEmptySound( );
{
ResetEmptySound( );
m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );
m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );
if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase() )
{
// only idle if the slid isn't back // only idle if the slid isn't back
if (m_iClip != 0) if (m_iClip != 0)
{ {

2
dlls/gearbox/massn.cpp

@ -127,7 +127,7 @@ void CMassn::Sniperrifle(void)
Vector vecShellVelocity = gpGlobals->v_right * RANDOM_FLOAT(40, 90) + gpGlobals->v_up * RANDOM_FLOAT(75, 200) + gpGlobals->v_forward * RANDOM_FLOAT(-40, 40); Vector vecShellVelocity = gpGlobals->v_right * RANDOM_FLOAT(40, 90) + gpGlobals->v_up * RANDOM_FLOAT(75, 200) + gpGlobals->v_forward * RANDOM_FLOAT(-40, 40);
EjectBrass(vecShootOrigin - vecShootDir * 24, vecShellVelocity, pev->angles.y, m_iBrassShell, TE_BOUNCE_SHELL); EjectBrass(vecShootOrigin - vecShootDir * 24, vecShellVelocity, pev->angles.y, m_iBrassShell, TE_BOUNCE_SHELL);
FireBullets(1, vecShootOrigin, vecShootDir, VECTOR_CONE_1DEGREES, 2048, BULLET_PLAYER_357, 0); // shoot +-7.5 degrees FireBullets(1, vecShootOrigin, vecShootDir, VECTOR_CONE_1DEGREES, 2048, BULLET_MONSTER_762, 0); // shoot +-7.5 degrees
pev->effects |= EF_MUZZLEFLASH; pev->effects |= EF_MUZZLEFLASH;

1
dlls/weapons.cpp

@ -177,6 +177,7 @@ void DecalGunshot( TraceResult *pTrace, int iBulletType )
case BULLET_MONSTER_MP5: case BULLET_MONSTER_MP5:
case BULLET_PLAYER_BUCKSHOT: case BULLET_PLAYER_BUCKSHOT:
case BULLET_PLAYER_357: case BULLET_PLAYER_357:
case BULLET_PLAYER_EAGLE:
case BULLET_MONSTER_357: case BULLET_MONSTER_357:
case BULLET_PLAYER_556: case BULLET_PLAYER_556:
case BULLET_MONSTER_556: case BULLET_MONSTER_556:

2
dlls/weapons.h

@ -219,6 +219,8 @@ typedef enum
BULLET_PLAYER_CROWBAR, // crowbar swipe BULLET_PLAYER_CROWBAR, // crowbar swipe
BULLET_PLAYER_556, // m249 BULLET_PLAYER_556, // m249
BULLET_PLAYER_762, // sniperrifle BULLET_PLAYER_762, // sniperrifle
BULLET_PLAYER_EAGLE, // desert eagle
BULLET_MONSTER_9MM, BULLET_MONSTER_9MM,
BULLET_MONSTER_MP5, BULLET_MONSTER_MP5,
BULLET_MONSTER_12MM, BULLET_MONSTER_12MM,

Loading…
Cancel
Save