From f48e0ce22878c2d6e75dbcf1e1374d0549a71b85 Mon Sep 17 00:00:00 2001 From: RAINBOW2000 Date: Sun, 5 Feb 2017 01:02:14 +0300 Subject: [PATCH] ... --- dlls/Android.mk | 1 + dlls/megachav.cpp | 33 +++------------------------------ dlls/sniper.cpp | 6 +++--- dlls/weapons.cpp | 8 ++------ 4 files changed, 9 insertions(+), 39 deletions(-) diff --git a/dlls/Android.mk b/dlls/Android.mk index 7f5412b5..23a201c3 100644 --- a/dlls/Android.mk +++ b/dlls/Android.mk @@ -37,6 +37,7 @@ LOCAL_SRC_FILES := agrunt.cpp airtank.cpp \ needle.cpp \ katana.cpp \ evilsci.cpp \ + sniper.cpp \ mariozombie.cpp \ megachav.cpp \ pink_panthera.cpp \ diff --git a/dlls/megachav.cpp b/dlls/megachav.cpp index 439a8cb0..819547bf 100644 --- a/dlls/megachav.cpp +++ b/dlls/megachav.cpp @@ -54,8 +54,6 @@ public: static const char *pIdleSounds[]; static const char *pAlertSounds[]; static const char *pPainSounds[]; - static const char *pAttackHitSounds[]; - static const char *pAttackMissSounds[]; // No range attacks BOOL CheckRangeAttack1( float flDot, float flDist ) { return FALSE; } @@ -65,18 +63,6 @@ public: LINK_ENTITY_TO_CLASS( monster_megachav, CMegachar ) -const char *CMegachar::pAttackHitSounds[] = -{ - "megachav/claw_strike1.wav", - "megachav/claw_strike2.wav", - "megachav/claw_strike3.wav", -}; - -const char *CMegachar::pAttackMissSounds[] = -{ - "megachav/claw_miss1.wav", - "megachav/claw_miss2.wav", -}; const char *CMegachar::pAttackSounds[] = { @@ -200,10 +186,8 @@ void CMegachar::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100; } // Play a random attack hit sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5 , 5 ) ); - } + } else // Play a random attack miss sound - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); if( RANDOM_LONG( 0, 1 ) ) AttackSound(); @@ -222,11 +206,8 @@ void CMegachar::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->punchangle.x = 5; pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 100; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); } else - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); - if( RANDOM_LONG( 0, 1 ) ) AttackSound(); } @@ -242,11 +223,9 @@ void CMegachar::HandleAnimEvent( MonsterEvent_t *pEvent ) pHurt->pev->punchangle.x = 5; pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * -100; } - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackHitSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackHitSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); - } + } else - EMIT_SOUND_DYN( ENT( pev ), CHAN_WEAPON, pAttackMissSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackMissSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) ); - + if( RANDOM_LONG( 0, 1 ) ) AttackSound(); } @@ -288,12 +267,6 @@ void CMegachar::Precache() PRECACHE_MODEL( "models/megachav.mdl" ); - for( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ ) - PRECACHE_SOUND( (char *)pAttackHitSounds[i] ); - - for( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ ) - PRECACHE_SOUND( (char *)pAttackMissSounds[i] ); - for( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ ) PRECACHE_SOUND( (char *)pAttackSounds[i] ); diff --git a/dlls/sniper.cpp b/dlls/sniper.cpp index 0b2767c3..3f74bff4 100644 --- a/dlls/sniper.cpp +++ b/dlls/sniper.cpp @@ -13,6 +13,7 @@ #include "nodes.h" #include "soundent.h" #define WEAPON_SNIPARS 18 + class CSnipars : public CBasePlayerWeapon { public: @@ -80,7 +81,6 @@ int CSnipars::GetItemInfo(ItemInfo *p) return 1; } -DEFINE_FIELD( CSnipars, m_fInZoom, FIELD_INTEGER ), int CSnipars::AddToPlayer( CBasePlayer *pPlayer ) { @@ -285,7 +285,7 @@ class CSniparsAmmo : public CBasePlayerAmmo void Spawn( void ) { Precache( ); - SET_MODEL(ENT(pev), "models/w_sniper.mdl"); + SET_MODEL(ENT(pev), "models/w_357ammo.mdl"); CBasePlayerAmmo::Spawn( ); } void Precache( void ) @@ -303,6 +303,6 @@ class CSniparsAmmo : public CBasePlayerAmmo return FALSE; } }; -LINK_ENTITY_TO_CLASS( ammo_snipars2, CSniparsAmmo ); +LINK_ENTITY_TO_CLASS( ammo_snipars, CSniparsAmmo ); #endif diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index b8e5bae2..8239cf53 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -415,12 +415,8 @@ IMPLEMENT_SAVERESTORE( CBasePlayerItem, CBaseAnimating ) TYPEDESCRIPTION CBasePlayerWeapon::m_SaveData[] = { #if defined( CLIENT_WEAPONS ) - DEFINE_FIELD( CBasePlayerWeapon, m_flNextPrimaryAttack, FIELD_FLOAT ), - DEFINE_FIELD( CBasePlayerWeapon, m_flNextSecondaryAttack, FIELD_FLOAT ), - DEFINE_FIELD( CBasePlayerWeapon, m_flTimeWeaponIdle, FIELD_FLOAT ), -#else // CLIENT_WEAPONS - DEFINE_FIELD( CBasePlayerWeapon, m_flNextPrimaryAttack, FIELD_TIME ), - DEFINE_FIELD( CBasePlayerWeapon, m_flNextSecondaryAttack, FIELD_TIME ), + DEFINE_FIELD( CBasePlayerWeapon, m_flNextPrimaryAttack, FIELD_TIME ), + DEFINE_FIELD( CBasePlayerWeapon, m_flNextSecondaryAttack, FIELD_TIME ), DEFINE_FIELD( CBasePlayerWeapon, m_flTimeWeaponIdle, FIELD_TIME ), #endif // CLIENT_WEAPONS DEFINE_FIELD( CBasePlayerWeapon, m_iPrimaryAmmoType, FIELD_INTEGER ),