mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-24 05:34:18 +00:00
...
This commit is contained in:
parent
2a1da47751
commit
f48e0ce228
@ -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 \
|
||||
|
@ -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] );
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 ),
|
||||
|
Loading…
x
Reference in New Issue
Block a user