Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
LostGamerHL committed Feb 4, 2017
1 parent 2a1da47 commit f48e0ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 39 deletions.
1 change: 1 addition & 0 deletions dlls/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
33 changes: 3 additions & 30 deletions dlls/megachav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ class CMegachar : public CBaseMonster
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; }
Expand All @@ -65,18 +63,6 @@ class CMegachar : public CBaseMonster

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[] =
{
Expand Down Expand Up @@ -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();
Expand All @@ -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();
}
Expand All @@ -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();
}
Expand Down Expand Up @@ -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] );

Expand Down
6 changes: 3 additions & 3 deletions dlls/sniper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "nodes.h"
#include "soundent.h"
#define WEAPON_SNIPARS 18

class CSnipars : public CBasePlayerWeapon
{
public:
Expand Down Expand Up @@ -80,7 +81,6 @@ int CSnipars::GetItemInfo(ItemInfo *p)

return 1;
}
DEFINE_FIELD( CSnipars, m_fInZoom, FIELD_INTEGER ),

int CSnipars::AddToPlayer( CBasePlayer *pPlayer )
{
Expand Down Expand Up @@ -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 )
Expand All @@ -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
8 changes: 2 additions & 6 deletions dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand Down

0 comments on commit f48e0ce

Please sign in to comment.