mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 21:24:27 +00:00
Monsters Sound fix,monster heealth and some weapons
This commit is contained in:
parent
9b90d15272
commit
dfc2a8d1da
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,6 +4,7 @@
|
||||
*/*.o
|
||||
*/*/*.o
|
||||
*.a
|
||||
*~
|
||||
*.framework
|
||||
*.exe
|
||||
build/
|
@ -45,18 +45,6 @@ public:
|
||||
|
||||
float m_flNextFlinch;
|
||||
|
||||
void PainSound( void );
|
||||
void AlertSound( void );
|
||||
void IdleSound( void );
|
||||
void AttackSound( void );
|
||||
|
||||
static const char *pAttackSounds[];
|
||||
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; }
|
||||
BOOL CheckRangeAttack2( float flDot, float flDist ) { return FALSE; }
|
||||
@ -65,37 +53,6 @@ public:
|
||||
|
||||
LINK_ENTITY_TO_CLASS( monster_bonewheel, CBonewheel )
|
||||
|
||||
const char *CBonewheel::pAttackHitSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CBonewheel::pAttackMissSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CBonewheel::pAttackSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CBonewheel::pIdleSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CBonewheel::pAlertSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CBonewheel::pPainSounds[] =
|
||||
{
|
||||
"zombie/s_pain1.wav",
|
||||
"zombie/s_pain2.wav",
|
||||
};
|
||||
|
||||
//=========================================================
|
||||
// Classify - indicates this monster's place in the
|
||||
// relationship table.
|
||||
@ -136,38 +93,9 @@ int CBonewheel::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, flo
|
||||
|
||||
// HACK HACK -- until we fix this.
|
||||
if( IsAlive() )
|
||||
PainSound();
|
||||
return CBaseMonster::TakeDamage( pevInflictor, pevAttacker, flDamage, bitsDamageType );
|
||||
}
|
||||
|
||||
void CBonewheel::PainSound( void )
|
||||
{
|
||||
int pitch = 95 + RANDOM_LONG( 0, 9 );
|
||||
|
||||
if( RANDOM_LONG( 0, 5 ) < 2 )
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch );
|
||||
}
|
||||
|
||||
void CBonewheel::AlertSound( void )
|
||||
{
|
||||
int pitch = 95 + RANDOM_LONG( 0, 9 );
|
||||
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[ RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch );
|
||||
}
|
||||
|
||||
void CBonewheel::IdleSound( void )
|
||||
{
|
||||
int pitch = 95 + RANDOM_LONG( 0, 9 );
|
||||
|
||||
// Play a random idle sound
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pIdleSounds[RANDOM_LONG( 0, ARRAYSIZE( pIdleSounds ) -1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) );
|
||||
}
|
||||
|
||||
void CBonewheel::AttackSound( void )
|
||||
{
|
||||
// Play a random attack sound
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) );
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// HandleAnimEvent - catches the monster-specific messages
|
||||
@ -190,14 +118,7 @@ void CBonewheel::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->punchangle.x = 5;
|
||||
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();
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_LEFT:
|
||||
@ -213,13 +134,7 @@ void CBonewheel::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();
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_BOTH:
|
||||
@ -233,13 +148,7 @@ void CBonewheel::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();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -278,24 +187,6 @@ void CBonewheel::Precache()
|
||||
int i;
|
||||
|
||||
PRECACHE_MODEL( "models/bonewheel.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] );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ )
|
||||
PRECACHE_SOUND( (char *)pIdleSounds[i] );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ )
|
||||
PRECACHE_SOUND( (char *)pAlertSounds[i] );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )
|
||||
PRECACHE_SOUND( (char *)pPainSounds[i] );
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
|
107
dlls/evilsci.cpp
107
dlls/evilsci.cpp
@ -45,17 +45,6 @@ public:
|
||||
|
||||
float m_flNextFlinch;
|
||||
|
||||
void PainSound( void );
|
||||
void AlertSound( void );
|
||||
void IdleSound( void );
|
||||
void AttackSound( void );
|
||||
|
||||
static const char *pAttackSounds[];
|
||||
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; }
|
||||
@ -64,40 +53,6 @@ public:
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS( monster_evilsci, CEvisci )
|
||||
|
||||
const char *CEvisci::pAttackHitSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CEvisci::pAttackMissSounds[]
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CEvisci::pAttackSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CEvisci::pIdleSounds[] =
|
||||
{
|
||||
"zombie/zo_idle1.wav",
|
||||
"zombie/zo_idle2.wav",
|
||||
"zombie/zo_idle3.wav",
|
||||
"zombie/zo_idle4.wav",
|
||||
};
|
||||
|
||||
const char *CEvisci::pAlertSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CEvisci::pPainSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
//=========================================================
|
||||
// Classify - indicates this monster's place in the
|
||||
// relationship table.
|
||||
@ -138,38 +93,11 @@ int CEvisci::TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float
|
||||
|
||||
// HACK HACK -- until we fix this.
|
||||
if( IsAlive() )
|
||||
PainSound();
|
||||
return CBaseMonster::TakeDamage( pevInflictor, pevAttacker, flDamage, bitsDamageType );
|
||||
}
|
||||
|
||||
void CEvisci::PainSound( void )
|
||||
{
|
||||
int pitch = 95 + RANDOM_LONG( 0, 9 );
|
||||
|
||||
if( RANDOM_LONG( 0, 5 ) < 2 )
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch );
|
||||
}
|
||||
|
||||
void CEvisci::AlertSound( void )
|
||||
{
|
||||
int pitch = 95 + RANDOM_LONG( 0, 9 );
|
||||
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAlertSounds[ RANDOM_LONG( 0, ARRAYSIZE( pAlertSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch );
|
||||
}
|
||||
|
||||
void CEvisci::IdleSound( void )
|
||||
{
|
||||
int pitch = 95 + RANDOM_LONG( 0, 9 );
|
||||
|
||||
// Play a random idle sound
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pIdleSounds[RANDOM_LONG( 0, ARRAYSIZE( pIdleSounds ) -1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) );
|
||||
}
|
||||
|
||||
void CEvisci::AttackSound( void )
|
||||
{
|
||||
// Play a random attack sound
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pAttackSounds[RANDOM_LONG( 0, ARRAYSIZE( pAttackSounds ) - 1 )], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG( -5, 5 ) );
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// HandleAnimEvent - catches the monster-specific messages
|
||||
@ -192,14 +120,8 @@ void CEvisci::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->punchangle.x = 5;
|
||||
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();
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_LEFT:
|
||||
@ -215,13 +137,7 @@ void CEvisci::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();
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_BOTH:
|
||||
@ -235,13 +151,7 @@ void CEvisci::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();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -281,23 +191,6 @@ void CEvisci::Precache()
|
||||
|
||||
PRECACHE_MODEL( "models/evilsci.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] );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ )
|
||||
PRECACHE_SOUND( (char *)pIdleSounds[i] );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ )
|
||||
PRECACHE_SOUND( (char *)pAlertSounds[i] );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )
|
||||
PRECACHE_SOUND( (char *)pPainSounds[i] );
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
|
271
dlls/knife.cpp
271
dlls/knife.cpp
@ -1,271 +0,0 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
* object code is restricted to non-commercial enhancements to products from
|
||||
* Valve LLC. All other use, distribution, or modification is prohibited
|
||||
* without written permission from Valve LLC.
|
||||
*
|
||||
****/
|
||||
|
||||
#include "extdll.h"
|
||||
#include "util.h"
|
||||
#include "cbase.h"
|
||||
#include "monsters.h"
|
||||
#include "weapons.h"
|
||||
#include "nodes.h"
|
||||
#include "player.h"
|
||||
#include "gamerules.h"
|
||||
|
||||
void FindHullIntersection(const Vector &vecSrc, TraceResult &tr, float *mins, float *maxs, edict_t *pEntity);
|
||||
|
||||
#define KNIFE_BODYHIT_VOLUME 128
|
||||
#define KNIFE_WALLHIT_VOLUME 512
|
||||
|
||||
LINK_ENTITY_TO_CLASS(weapon_knife, CKnife);
|
||||
|
||||
enum knife_e {
|
||||
KNIFE_IDLE1 = 0,
|
||||
KNIFE_DRAW,
|
||||
KNIFE_HOLSTER,
|
||||
KNIFE_ATTACK1HIT,
|
||||
KNIFE_ATTACK1MISS,
|
||||
KNIFE_ATTACK2MISS,
|
||||
KNIFE_ATTACK2HIT,
|
||||
KNIFE_ATTACK3MISS,
|
||||
KNIFE_ATTACK3HIT,
|
||||
KNIFE_IDLE2,
|
||||
KNIFE_IDLE3,
|
||||
KNIFE_CHARGE,
|
||||
KNIFE_STAB,
|
||||
};
|
||||
|
||||
|
||||
void CKnife::Spawn()
|
||||
{
|
||||
Precache();
|
||||
m_iId = WEAPON_KNIFE;
|
||||
SET_MODEL(ENT(pev), "models/w_knife.mdl");
|
||||
m_iClip = -1;
|
||||
|
||||
FallInit();// get ready to fall down.
|
||||
}
|
||||
|
||||
|
||||
void CKnife::Precache(void)
|
||||
{
|
||||
PRECACHE_MODEL("models/v_knife.mdl");
|
||||
PRECACHE_MODEL("models/w_knife.mdl");
|
||||
PRECACHE_MODEL("models/p_knife.mdl");
|
||||
PRECACHE_SOUND("weapons/knife_hit_flesh1.wav");
|
||||
PRECACHE_SOUND("weapons/knife_hit_flesh2.wav");
|
||||
PRECACHE_SOUND("weapons/knife_hit_wall1.wav");
|
||||
PRECACHE_SOUND("weapons/knife_hit_wall2.wav");
|
||||
PRECACHE_SOUND("weapons/knife1.wav");
|
||||
PRECACHE_SOUND("weapons/knife2.wav");
|
||||
PRECACHE_SOUND("weapons/knife3.wav");
|
||||
|
||||
m_usKnife = PRECACHE_EVENT(1, "events/knife.sc");
|
||||
}
|
||||
|
||||
int CKnife::GetItemInfo(ItemInfo *p)
|
||||
{
|
||||
p->pszName = STRING(pev->classname);
|
||||
p->pszAmmo1 = NULL;
|
||||
p->iMaxAmmo1 = -1;
|
||||
p->pszAmmo2 = NULL;
|
||||
p->iMaxAmmo2 = -1;
|
||||
p->iMaxClip = WEAPON_NOCLIP;
|
||||
p->iSlot = 0;
|
||||
p->iPosition = 2;
|
||||
p->iId = WEAPON_KNIFE;
|
||||
p->iWeight = KNIFE_WEIGHT;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL CKnife::Deploy()
|
||||
{
|
||||
return DefaultDeploy("models/v_knife.mdl", "models/p_knife.mdl", KNIFE_DRAW, "knife");
|
||||
}
|
||||
|
||||
void CKnife::Holster(int skiplocal /* = 0 */)
|
||||
{
|
||||
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
|
||||
SendWeaponAnim(KNIFE_HOLSTER);
|
||||
}
|
||||
|
||||
void CKnife::PrimaryAttack()
|
||||
{
|
||||
if (!Swing(1))
|
||||
{
|
||||
SetThink(&CKnife::SwingAgain);
|
||||
pev->nextthink = gpGlobals->time + 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CKnife::Smack()
|
||||
{
|
||||
DecalGunshot(&m_trHit, BULLET_PLAYER_CROWBAR);
|
||||
}
|
||||
|
||||
|
||||
void CKnife::SwingAgain(void)
|
||||
{
|
||||
Swing(0);
|
||||
}
|
||||
|
||||
|
||||
int CKnife::Swing(int fFirst)
|
||||
{
|
||||
int fDidHit = FALSE;
|
||||
|
||||
TraceResult tr;
|
||||
|
||||
UTIL_MakeVectors(m_pPlayer->pev->v_angle);
|
||||
Vector vecSrc = m_pPlayer->GetGunPosition();
|
||||
Vector vecEnd = vecSrc + gpGlobals->v_forward * 32;
|
||||
|
||||
UTIL_TraceLine(vecSrc, vecEnd, dont_ignore_monsters, ENT(m_pPlayer->pev), &tr);
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
if (tr.flFraction >= 1.0)
|
||||
{
|
||||
UTIL_TraceHull(vecSrc, vecEnd, dont_ignore_monsters, head_hull, ENT(m_pPlayer->pev), &tr);
|
||||
if (tr.flFraction < 1.0)
|
||||
{
|
||||
// Calculate the point of intersection of the line (or hull) and the object we hit
|
||||
// This is and approximation of the "best" intersection
|
||||
CBaseEntity *pHit = CBaseEntity::Instance(tr.pHit);
|
||||
if (!pHit || pHit->IsBSPModel())
|
||||
FindHullIntersection(vecSrc, tr, VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX, m_pPlayer->edict());
|
||||
vecEnd = tr.vecEndPos; // This is the point on the actual surface (the hull could have hit space)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
PLAYBACK_EVENT_FULL(FEV_NOTHOST, m_pPlayer->edict(), m_usKnife,
|
||||
0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0, 0, 0,
|
||||
0.0, 0, 0.0);
|
||||
|
||||
|
||||
if (tr.flFraction >= 1.0)
|
||||
{
|
||||
if (fFirst)
|
||||
{
|
||||
// miss
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.5);
|
||||
|
||||
// player "shoot" animation
|
||||
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (((m_iSwing++) % 2) + 1)
|
||||
{
|
||||
case 0:
|
||||
SendWeaponAnim(KNIFE_ATTACK1HIT); break;
|
||||
case 1:
|
||||
SendWeaponAnim(KNIFE_ATTACK2HIT); break;
|
||||
case 2:
|
||||
SendWeaponAnim(KNIFE_ATTACK3HIT); break;
|
||||
}
|
||||
|
||||
// player "shoot" animation
|
||||
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
|
||||
// hit
|
||||
fDidHit = TRUE;
|
||||
CBaseEntity *pEntity = CBaseEntity::Instance(tr.pHit);
|
||||
|
||||
ClearMultiDamage();
|
||||
|
||||
if ((m_flNextPrimaryAttack + 1 < UTIL_WeaponTimeBase()) || g_pGameRules->IsMultiplayer())
|
||||
{
|
||||
// first swing does full damage
|
||||
pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgKnife, gpGlobals->v_forward, &tr, DMG_CLUB);
|
||||
}
|
||||
else
|
||||
{
|
||||
// subsequent swings do half
|
||||
pEntity->TraceAttack(m_pPlayer->pev, gSkillData.plrDmgKnife / 2, gpGlobals->v_forward, &tr, DMG_CLUB);
|
||||
}
|
||||
ApplyMultiDamage(m_pPlayer->pev, m_pPlayer->pev);
|
||||
|
||||
// play thwack, smack, or dong sound
|
||||
float flVol = 1.0;
|
||||
int fHitWorld = TRUE;
|
||||
|
||||
if (pEntity)
|
||||
{
|
||||
if (pEntity->Classify() != CLASS_NONE && pEntity->Classify() != CLASS_MACHINE)
|
||||
{
|
||||
// play thwack or smack sound
|
||||
switch (RANDOM_LONG(0, 1))
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/knife_hit_flesh1.wav", 1, ATTN_NORM); break;
|
||||
case 1:
|
||||
EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/knife_hit_flesh2.wav", 1, ATTN_NORM); break;
|
||||
}
|
||||
m_pPlayer->m_iWeaponVolume = KNIFE_BODYHIT_VOLUME;
|
||||
if (!pEntity->IsAlive())
|
||||
return TRUE;
|
||||
else
|
||||
flVol = 0.1;
|
||||
|
||||
fHitWorld = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// play texture hit sound
|
||||
// UNDONE: Calculate the correct point of intersection when we hit with the hull instead of the line
|
||||
|
||||
if (fHitWorld)
|
||||
{
|
||||
float fvolbar = TEXTURETYPE_PlaySound(&tr, vecSrc, vecSrc + (vecEnd - vecSrc) * 2, BULLET_PLAYER_CROWBAR);
|
||||
|
||||
if (g_pGameRules->IsMultiplayer())
|
||||
{
|
||||
// override the volume here, cause we don't play texture sounds in multiplayer,
|
||||
// and fvolbar is going to be 0 from the above call.
|
||||
|
||||
fvolbar = 1;
|
||||
}
|
||||
|
||||
// also play crowbar strike
|
||||
switch (RANDOM_LONG(0, 1))
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/knife_hit_wall1.wav", fvolbar, ATTN_NORM, 0, 98 + RANDOM_LONG(0, 3));
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND_DYN(ENT(m_pPlayer->pev), CHAN_ITEM, "weapons/knife_hit_wall2.wav", fvolbar, ATTN_NORM, 0, 98 + RANDOM_LONG(0, 3));
|
||||
break;
|
||||
}
|
||||
|
||||
// delay the decal a bit
|
||||
m_trHit = tr;
|
||||
}
|
||||
|
||||
m_pPlayer->m_iWeaponVolume = flVol * KNIFE_WALLHIT_VOLUME;
|
||||
#endif
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.25);
|
||||
|
||||
SetThink(&CKnife::Smack);
|
||||
pev->nextthink = UTIL_WeaponTimeBase() + 0.2;
|
||||
|
||||
|
||||
}
|
||||
return fDidHit;
|
||||
}
|
@ -270,7 +270,7 @@ void CMegachar::Spawn()
|
||||
pev->solid = SOLID_SLIDEBOX;
|
||||
pev->movetype = MOVETYPE_STEP;
|
||||
m_bloodColor = BLOOD_COLOR_GREEN;
|
||||
pev->health = 10000;
|
||||
pev->health = 1000;
|
||||
pev->view_ofs = VEC_VIEW;// position of the eyes relative to monster's origin.
|
||||
m_flFieldOfView = 0.9;// indicates the width of this monster's forward view cone ( as a dotproduct result )
|
||||
m_MonsterState = MONSTERSTATE_NONE;
|
||||
|
601
dlls/penguin.cpp
601
dlls/penguin.cpp
@ -1,601 +0,0 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2001, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Use, distribution, and modification of this source code and/or resulting
|
||||
* object code is restricted to non-commercial enhancements to products from
|
||||
* Valve LLC. All other use, distribution, or modification is prohibited
|
||||
* without written permission from Valve LLC.
|
||||
*
|
||||
****/
|
||||
#if !defined( OEM_BUILD ) && !defined( HLDEMO_BUILD )
|
||||
|
||||
#include "extdll.h"
|
||||
#include "util.h"
|
||||
#include "cbase.h"
|
||||
#include "monsters.h"
|
||||
#include "weapons.h"
|
||||
#include "nodes.h"
|
||||
#include "player.h"
|
||||
#include "soundent.h"
|
||||
#include "gamerules.h"
|
||||
|
||||
enum w_penguin_e {
|
||||
WPENGUIN_IDLE1 = 0,
|
||||
WPENGUIN_FIDGET,
|
||||
WPENGUIN_JUMP,
|
||||
WPENGUIN_RUN,
|
||||
};
|
||||
|
||||
enum penguin_e {
|
||||
PENGUIN_IDLE1 = 0,
|
||||
PENGUIN_FIDGETFIT,
|
||||
PENGUIN_FIDGETNIP,
|
||||
PENGUIN_DOWN,
|
||||
PENGUIN_UP,
|
||||
PENGUIN_THROW
|
||||
};
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
|
||||
class CPenguinGrenade : public CGrenade
|
||||
{
|
||||
void Spawn(void);
|
||||
void Precache(void);
|
||||
int Classify(void);
|
||||
void EXPORT SuperBounceTouch(CBaseEntity *pOther);
|
||||
void EXPORT HuntThink(void);
|
||||
int BloodColor(void) { return BLOOD_COLOR_YELLOW; }
|
||||
void Killed(entvars_t *pevAttacker, int iGib);
|
||||
void GibMonster(void);
|
||||
|
||||
virtual int Save(CSave &save);
|
||||
virtual int Restore(CRestore &restore);
|
||||
|
||||
static TYPEDESCRIPTION m_SaveData[];
|
||||
|
||||
static float m_flNextBounceSoundTime;
|
||||
|
||||
// CBaseEntity *m_pTarget;
|
||||
float m_flDie;
|
||||
Vector m_vecTarget;
|
||||
float m_flNextHunt;
|
||||
float m_flNextHit;
|
||||
Vector m_posPrev;
|
||||
EHANDLE m_hOwner;
|
||||
int m_iMyClass;
|
||||
};
|
||||
|
||||
float CPenguinGrenade::m_flNextBounceSoundTime = 0;
|
||||
|
||||
LINK_ENTITY_TO_CLASS(monster_penguin, CPenguinGrenade);
|
||||
TYPEDESCRIPTION CPenguinGrenade::m_SaveData[] =
|
||||
{
|
||||
DEFINE_FIELD(CPenguinGrenade, m_flDie, FIELD_TIME),
|
||||
DEFINE_FIELD(CPenguinGrenade, m_vecTarget, FIELD_VECTOR),
|
||||
DEFINE_FIELD(CPenguinGrenade, m_flNextHunt, FIELD_TIME),
|
||||
DEFINE_FIELD(CPenguinGrenade, m_flNextHit, FIELD_TIME),
|
||||
DEFINE_FIELD(CPenguinGrenade, m_posPrev, FIELD_POSITION_VECTOR),
|
||||
DEFINE_FIELD(CPenguinGrenade, m_hOwner, FIELD_EHANDLE),
|
||||
};
|
||||
|
||||
IMPLEMENT_SAVERESTORE(CPenguinGrenade, CGrenade);
|
||||
|
||||
#define PENGUIN_DETONATE_DELAY 15.0
|
||||
|
||||
int CPenguinGrenade::Classify(void)
|
||||
{
|
||||
if (m_iMyClass != 0)
|
||||
return m_iMyClass; // protect against recursion
|
||||
|
||||
if (m_hEnemy != NULL)
|
||||
{
|
||||
m_iMyClass = CLASS_INSECT; // no one cares about it
|
||||
switch (m_hEnemy->Classify())
|
||||
{
|
||||
case CLASS_PLAYER:
|
||||
case CLASS_HUMAN_PASSIVE:
|
||||
case CLASS_HUMAN_MILITARY:
|
||||
m_iMyClass = 0;
|
||||
return CLASS_ALIEN_MILITARY; // barney's get mad, grunts get mad at it
|
||||
}
|
||||
m_iMyClass = 0;
|
||||
}
|
||||
|
||||
return CLASS_ALIEN_BIOWEAPON;
|
||||
}
|
||||
|
||||
void CPenguinGrenade::Spawn(void)
|
||||
{
|
||||
Precache();
|
||||
// motor
|
||||
pev->movetype = MOVETYPE_BOUNCE;
|
||||
pev->solid = SOLID_BBOX;
|
||||
|
||||
SET_MODEL(ENT(pev), "models/w_penguin.mdl");
|
||||
UTIL_SetSize(pev, Vector(-4, -4, 0), Vector(4, 4, 8));
|
||||
UTIL_SetOrigin(pev, pev->origin);
|
||||
|
||||
SetTouch(&CPenguinGrenade::SuperBounceTouch);
|
||||
SetThink(&CPenguinGrenade::HuntThink);
|
||||
pev->nextthink = gpGlobals->time + 0.1;
|
||||
m_flNextHunt = gpGlobals->time + 1E6;
|
||||
|
||||
pev->flags |= FL_MONSTER;
|
||||
pev->takedamage = DAMAGE_AIM;
|
||||
pev->health = gSkillData.snarkHealth;
|
||||
pev->gravity = 0.5;
|
||||
pev->friction = 0.5;
|
||||
|
||||
pev->dmg = gSkillData.snarkDmgPop;
|
||||
|
||||
m_flDie = gpGlobals->time + PENGUIN_DETONATE_DELAY;
|
||||
|
||||
m_flFieldOfView = 0; // 180 degrees
|
||||
|
||||
if (pev->owner)
|
||||
m_hOwner = Instance(pev->owner);
|
||||
|
||||
m_flNextBounceSoundTime = gpGlobals->time;// reset each time a snark is spawned.
|
||||
|
||||
pev->sequence = WPENGUIN_RUN;
|
||||
ResetSequenceInfo();
|
||||
}
|
||||
|
||||
void CPenguinGrenade::Precache(void)
|
||||
{
|
||||
PRECACHE_MODEL("models/w_penguin.mdl");
|
||||
PRECACHE_SOUND("squeek/sqk_blast1.wav");
|
||||
PRECACHE_SOUND("common/bodysplat.wav");
|
||||
PRECACHE_SOUND("squeek/sqk_die1.wav");
|
||||
PRECACHE_SOUND("squeek/sqk_hunt1.wav");
|
||||
PRECACHE_SOUND("squeek/sqk_hunt2.wav");
|
||||
PRECACHE_SOUND("squeek/sqk_hunt3.wav");
|
||||
PRECACHE_SOUND("squeek/sqk_deploy1.wav");
|
||||
}
|
||||
|
||||
|
||||
void CPenguinGrenade::Killed(entvars_t *pevAttacker, int iGib)
|
||||
{
|
||||
pev->model = iStringNull;// make invisible
|
||||
SetThink(&CPenguinGrenade::SUB_Remove);
|
||||
SetTouch(NULL);
|
||||
pev->nextthink = gpGlobals->time + 0.1;
|
||||
|
||||
// since squeak grenades never leave a body behind, clear out their takedamage now.
|
||||
// Squeaks do a bit of radius damage when they pop, and that radius damage will
|
||||
// continue to call this function unless we acknowledge the Squeak's death now. (sjb)
|
||||
pev->takedamage = DAMAGE_NO;
|
||||
|
||||
// play squeek blast
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_ITEM, "squeek/sqk_blast1.wav", 1, 0.5, 0, PITCH_NORM);
|
||||
|
||||
CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, SMALL_EXPLOSION_VOLUME, 3.0);
|
||||
|
||||
UTIL_BloodDrips(pev->origin, g_vecZero, BloodColor(), 80);
|
||||
|
||||
if (m_hOwner != NULL)
|
||||
RadiusDamage(pev, m_hOwner->pev, pev->dmg, CLASS_NONE, DMG_BLAST);
|
||||
else
|
||||
RadiusDamage(pev, pev, pev->dmg, CLASS_NONE, DMG_BLAST);
|
||||
|
||||
// reset owner so death message happens
|
||||
if (m_hOwner != NULL)
|
||||
pev->owner = m_hOwner->edict();
|
||||
|
||||
CBaseMonster::Killed(pevAttacker, GIB_ALWAYS);
|
||||
}
|
||||
|
||||
void CPenguinGrenade::GibMonster(void)
|
||||
{
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "common/bodysplat.wav", 0.75, ATTN_NORM, 0, 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CPenguinGrenade::HuntThink(void)
|
||||
{
|
||||
// ALERT( at_console, "think\n" );
|
||||
|
||||
if (!IsInWorld())
|
||||
{
|
||||
SetTouch(NULL);
|
||||
UTIL_Remove(this);
|
||||
return;
|
||||
}
|
||||
|
||||
StudioFrameAdvance();
|
||||
pev->nextthink = gpGlobals->time + 0.1;
|
||||
|
||||
// explode when ready
|
||||
if (gpGlobals->time >= m_flDie)
|
||||
{
|
||||
g_vecAttackDir = pev->velocity.Normalize();
|
||||
pev->health = -1;
|
||||
Killed(pev, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// float
|
||||
if (pev->waterlevel != 0)
|
||||
{
|
||||
if (pev->movetype == MOVETYPE_BOUNCE)
|
||||
{
|
||||
pev->movetype = MOVETYPE_FLY;
|
||||
}
|
||||
pev->velocity = pev->velocity * 0.9;
|
||||
pev->velocity.z += 8.0;
|
||||
}
|
||||
else if (pev->movetype = MOVETYPE_FLY)
|
||||
{
|
||||
pev->movetype = MOVETYPE_BOUNCE;
|
||||
}
|
||||
|
||||
// return if not time to hunt
|
||||
if (m_flNextHunt > gpGlobals->time)
|
||||
return;
|
||||
|
||||
m_flNextHunt = gpGlobals->time + 2.0;
|
||||
|
||||
CBaseEntity *pOther = NULL;
|
||||
Vector vecDir;
|
||||
TraceResult tr;
|
||||
|
||||
Vector vecFlat = pev->velocity;
|
||||
vecFlat.z = 0;
|
||||
vecFlat = vecFlat.Normalize();
|
||||
|
||||
UTIL_MakeVectors(pev->angles);
|
||||
|
||||
if (m_hEnemy == NULL || !m_hEnemy->IsAlive())
|
||||
{
|
||||
// find target, bounce a bit towards it.
|
||||
Look(512);
|
||||
m_hEnemy = BestVisibleEnemy();
|
||||
}
|
||||
|
||||
// squeek if it's about time blow up
|
||||
if ((m_flDie - gpGlobals->time <= 0.5) && (m_flDie - gpGlobals->time >= 0.3))
|
||||
{
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_die1.wav", 1, ATTN_NORM, 0, 100 + RANDOM_LONG(0, 0x3F));
|
||||
CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, 256, 0.25);
|
||||
}
|
||||
|
||||
// higher pitch as squeeker gets closer to detonation time
|
||||
float flpitch = 155.0 - 60.0 * ((m_flDie - gpGlobals->time) / PENGUIN_DETONATE_DELAY);
|
||||
if (flpitch < 80)
|
||||
flpitch = 80;
|
||||
|
||||
if (m_hEnemy != NULL)
|
||||
{
|
||||
if (FVisible(m_hEnemy))
|
||||
{
|
||||
vecDir = m_hEnemy->EyePosition() - pev->origin;
|
||||
m_vecTarget = vecDir.Normalize();
|
||||
}
|
||||
|
||||
float flVel = pev->velocity.Length();
|
||||
float flAdj = 50.0 / (flVel + 10.0);
|
||||
|
||||
if (flAdj > 1.2)
|
||||
flAdj = 1.2;
|
||||
|
||||
// ALERT( at_console, "think : enemy\n");
|
||||
|
||||
// ALERT( at_console, "%.0f %.2f %.2f %.2f\n", flVel, m_vecTarget.x, m_vecTarget.y, m_vecTarget.z );
|
||||
|
||||
pev->velocity = pev->velocity * flAdj + m_vecTarget * 300;
|
||||
}
|
||||
|
||||
if (pev->flags & FL_ONGROUND)
|
||||
{
|
||||
pev->avelocity = Vector(0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pev->avelocity == Vector(0, 0, 0))
|
||||
{
|
||||
pev->avelocity.x = RANDOM_FLOAT(-100, 100);
|
||||
pev->avelocity.z = RANDOM_FLOAT(-100, 100);
|
||||
}
|
||||
}
|
||||
|
||||
if ((pev->origin - m_posPrev).Length() < 1.0)
|
||||
{
|
||||
pev->velocity.x = RANDOM_FLOAT(-100, 100);
|
||||
pev->velocity.y = RANDOM_FLOAT(-100, 100);
|
||||
}
|
||||
m_posPrev = pev->origin;
|
||||
|
||||
pev->angles = UTIL_VecToAngles(pev->velocity);
|
||||
pev->angles.z = 0;
|
||||
pev->angles.x = 0;
|
||||
}
|
||||
|
||||
|
||||
void CPenguinGrenade::SuperBounceTouch(CBaseEntity *pOther)
|
||||
{
|
||||
float flpitch;
|
||||
|
||||
TraceResult tr = UTIL_GetGlobalTrace();
|
||||
|
||||
// don't hit the guy that launched this grenade
|
||||
if (pev->owner && pOther->edict() == pev->owner)
|
||||
return;
|
||||
|
||||
// at least until we've bounced once
|
||||
pev->owner = NULL;
|
||||
|
||||
pev->angles.x = 0;
|
||||
pev->angles.z = 0;
|
||||
|
||||
// avoid bouncing too much
|
||||
if (m_flNextHit > gpGlobals->time)
|
||||
return;
|
||||
|
||||
// higher pitch as squeeker gets closer to detonation time
|
||||
flpitch = 155.0 - 60.0 * ((m_flDie - gpGlobals->time) / PENGUIN_DETONATE_DELAY);
|
||||
|
||||
if (pOther->pev->takedamage && m_flNextAttack < gpGlobals->time)
|
||||
{
|
||||
// attack!
|
||||
|
||||
// make sure it's me who has touched them
|
||||
if (tr.pHit == pOther->edict())
|
||||
{
|
||||
// and it's not another squeakgrenade
|
||||
if (tr.pHit->v.modelindex != pev->modelindex)
|
||||
{
|
||||
// ALERT( at_console, "hit enemy\n");
|
||||
ClearMultiDamage();
|
||||
pOther->TraceAttack(pev, gSkillData.snarkDmgBite, gpGlobals->v_forward, &tr, DMG_SLASH);
|
||||
if (m_hOwner != NULL)
|
||||
ApplyMultiDamage(pev, m_hOwner->pev);
|
||||
else
|
||||
ApplyMultiDamage(pev, pev);
|
||||
|
||||
pev->dmg += gSkillData.snarkDmgPop; // add more explosion damage
|
||||
// m_flDie += 2.0; // add more life
|
||||
|
||||
// make bite sound
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_WEAPON, "squeek/sqk_deploy1.wav", 1.0, ATTN_NORM, 0, (int)flpitch);
|
||||
m_flNextAttack = gpGlobals->time + 0.5;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// ALERT( at_console, "been hit\n");
|
||||
}
|
||||
}
|
||||
|
||||
m_flNextHit = gpGlobals->time + 0.1;
|
||||
m_flNextHunt = gpGlobals->time;
|
||||
|
||||
if (g_pGameRules->IsMultiplayer())
|
||||
{
|
||||
// in multiplayer, we limit how often snarks can make their bounce sounds to prevent overflows.
|
||||
if (gpGlobals->time < m_flNextBounceSoundTime)
|
||||
{
|
||||
// too soon!
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(pev->flags & FL_ONGROUND))
|
||||
{
|
||||
// play bounce sound
|
||||
float flRndSound = RANDOM_FLOAT(0, 1);
|
||||
|
||||
if (flRndSound <= 0.33)
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt1.wav", 1, ATTN_NORM, 0, (int)flpitch);
|
||||
else if (flRndSound <= 0.66)
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, (int)flpitch);
|
||||
else
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, (int)flpitch);
|
||||
CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, 256, 0.25);
|
||||
}
|
||||
else
|
||||
{
|
||||
// skittering sound
|
||||
CSoundEnt::InsertSound(bits_SOUND_COMBAT, pev->origin, 100, 0.1);
|
||||
}
|
||||
|
||||
m_flNextBounceSoundTime = gpGlobals->time + 0.5;// half second.
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
LINK_ENTITY_TO_CLASS(weapon_penguin, CPenguin);
|
||||
|
||||
|
||||
void CPenguin::Spawn()
|
||||
{
|
||||
Precache();
|
||||
m_iId = WEAPON_PENGUIN;
|
||||
SET_MODEL(ENT(pev), "models/w_penguinnest.mdl");
|
||||
|
||||
FallInit();//get ready to fall down.
|
||||
|
||||
m_iDefaultAmmo = PENGUIN_DEFAULT_GIVE;
|
||||
|
||||
pev->sequence = 1;
|
||||
pev->animtime = gpGlobals->time;
|
||||
pev->framerate = 1.0;
|
||||
}
|
||||
|
||||
|
||||
void CPenguin::Precache(void)
|
||||
{
|
||||
PRECACHE_MODEL("models/w_penguinnest.mdl");
|
||||
PRECACHE_MODEL("models/v_penguin.mdl");
|
||||
PRECACHE_MODEL("models/p_penguin.mdl");
|
||||
PRECACHE_SOUND("squeek/sqk_hunt2.wav");
|
||||
PRECACHE_SOUND("squeek/sqk_hunt3.wav");
|
||||
UTIL_PrecacheOther("monster_penguin");
|
||||
|
||||
m_usPenguinFire = PRECACHE_EVENT(1, "events/penguinfire.sc");
|
||||
}
|
||||
|
||||
|
||||
int CPenguin::GetItemInfo(ItemInfo *p)
|
||||
{
|
||||
p->pszName = STRING(pev->classname);
|
||||
p->pszAmmo1 = "Penguins";
|
||||
p->iMaxAmmo1 = PENGUIN_MAX_CARRY;
|
||||
p->pszAmmo2 = NULL;
|
||||
p->iMaxAmmo2 = -1;
|
||||
p->iMaxClip = WEAPON_NOCLIP;
|
||||
p->iSlot = 4;
|
||||
p->iPosition = 4;
|
||||
p->iId = m_iId = WEAPON_PENGUIN;
|
||||
p->iWeight = PENGUIN_WEIGHT;
|
||||
p->iFlags = ITEM_FLAG_LIMITINWORLD | ITEM_FLAG_EXHAUSTIBLE;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOL CPenguin::Deploy()
|
||||
{
|
||||
// play hunt sound
|
||||
float flRndSound = RANDOM_FLOAT(0, 1);
|
||||
|
||||
if (flRndSound <= 0.5)
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 100);
|
||||
else
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 100);
|
||||
|
||||
m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;
|
||||
|
||||
return DefaultDeploy("models/v_penguin.mdl", "models/p_penguin.mdl", PENGUIN_UP, "penguin");
|
||||
}
|
||||
|
||||
|
||||
void CPenguin::Holster(int skiplocal /* = 0 */)
|
||||
{
|
||||
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
|
||||
|
||||
if (!m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
|
||||
{
|
||||
m_pPlayer->pev->weapons &= ~(1 << WEAPON_PENGUIN);
|
||||
SetThink(&CPenguin::DestroyItem);
|
||||
pev->nextthink = gpGlobals->time + 0.1;
|
||||
return;
|
||||
}
|
||||
|
||||
SendWeaponAnim(PENGUIN_DOWN);
|
||||
EMIT_SOUND(ENT(m_pPlayer->pev), CHAN_WEAPON, "common/null.wav", 1.0, ATTN_NORM);
|
||||
}
|
||||
|
||||
|
||||
void CPenguin::PrimaryAttack()
|
||||
{
|
||||
if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
|
||||
{
|
||||
UTIL_MakeVectors(m_pPlayer->pev->v_angle);
|
||||
TraceResult tr;
|
||||
Vector trace_origin;
|
||||
|
||||
// HACK HACK: Ugly hacks to handle change in origin based on new physics code for players
|
||||
// Move origin up if crouched and start trace a bit outside of body ( 20 units instead of 16 )
|
||||
trace_origin = m_pPlayer->pev->origin;
|
||||
if (m_pPlayer->pev->flags & FL_DUCKING)
|
||||
{
|
||||
trace_origin = trace_origin - (VEC_HULL_MIN - VEC_DUCK_HULL_MIN);
|
||||
}
|
||||
|
||||
// find place to toss monster
|
||||
UTIL_TraceLine(trace_origin + gpGlobals->v_forward * 20, trace_origin + gpGlobals->v_forward * 64, dont_ignore_monsters, NULL, &tr);
|
||||
|
||||
int flags;
|
||||
#ifdef CLIENT_WEAPONS
|
||||
flags = FEV_NOTHOST;
|
||||
#else
|
||||
flags = 0;
|
||||
#endif
|
||||
|
||||
PLAYBACK_EVENT_FULL(flags, m_pPlayer->edict(), m_usPenguinFire, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0);
|
||||
|
||||
if (tr.fAllSolid == 0 && tr.fStartSolid == 0 && tr.flFraction > 0.25)
|
||||
{
|
||||
// player "shoot" animation
|
||||
m_pPlayer->SetAnimation(PLAYER_ATTACK1);
|
||||
|
||||
#ifndef CLIENT_DLL
|
||||
CBaseEntity *pSqueak = CBaseEntity::Create("monster_penguin", tr.vecEndPos, m_pPlayer->pev->v_angle, m_pPlayer->edict());
|
||||
pSqueak->pev->velocity = gpGlobals->v_forward * 200 + m_pPlayer->pev->velocity;
|
||||
#endif
|
||||
|
||||
// play hunt sound
|
||||
float flRndSound = RANDOM_FLOAT(0, 1);
|
||||
|
||||
if (flRndSound <= 0.5)
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt2.wav", 1, ATTN_NORM, 0, 105);
|
||||
else
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "squeek/sqk_hunt3.wav", 1, ATTN_NORM, 0, 105);
|
||||
|
||||
m_pPlayer->m_iWeaponVolume = QUIET_GUN_VOLUME;
|
||||
|
||||
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
|
||||
|
||||
m_fJustThrown = 1;
|
||||
|
||||
m_flNextPrimaryAttack = GetNextAttackDelay(0.3);
|
||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CPenguin::SecondaryAttack(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CPenguin::WeaponIdle(void)
|
||||
{
|
||||
if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
|
||||
return;
|
||||
|
||||
if (m_fJustThrown)
|
||||
{
|
||||
m_fJustThrown = 0;
|
||||
|
||||
if (!m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()])
|
||||
{
|
||||
RetireWeapon();
|
||||
return;
|
||||
}
|
||||
|
||||
SendWeaponAnim(PENGUIN_UP);
|
||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + UTIL_SharedRandomFloat(m_pPlayer->random_seed, 10, 15);
|
||||
return;
|
||||
}
|
||||
|
||||
int iAnim;
|
||||
float flRand = UTIL_SharedRandomFloat(m_pPlayer->random_seed, 0, 1);
|
||||
if (flRand <= 0.75)
|
||||
{
|
||||
iAnim = PENGUIN_IDLE1;
|
||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 30.0 / 16 * (2);
|
||||
}
|
||||
else if (flRand <= 0.875)
|
||||
{
|
||||
iAnim = PENGUIN_FIDGETFIT;
|
||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 70.0 / 16.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
iAnim = PENGUIN_FIDGETNIP;
|
||||
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 80.0 / 16.0;
|
||||
}
|
||||
SendWeaponAnim(iAnim);
|
||||
}
|
||||
|
||||
#endif
|
@ -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,15 +63,6 @@ public:
|
||||
|
||||
LINK_ENTITY_TO_CLASS( monster_pink_panther, CPinkPanther )
|
||||
|
||||
const char *CPinkPanther::pAttackHitSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CPinkPanther::pAttackMissSounds[] =
|
||||
{
|
||||
"turret/tu_alert.wav",
|
||||
};
|
||||
|
||||
const char *CPinkPanther::pAttackSounds[] =
|
||||
{
|
||||
@ -196,11 +185,8 @@ void CPinkPanther::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->punchangle.x = 5;
|
||||
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();
|
||||
@ -219,10 +205,8 @@ void CPinkPanther::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();
|
||||
@ -239,10 +223,8 @@ void CPinkPanther::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();
|
||||
@ -267,7 +249,7 @@ void CPinkPanther::Spawn()
|
||||
pev->solid = SOLID_SLIDEBOX;
|
||||
pev->movetype = MOVETYPE_STEP;
|
||||
m_bloodColor = BLOOD_COLOR_RED;
|
||||
pev->health = 360;
|
||||
pev->health = 250;
|
||||
pev->view_ofs = VEC_VIEW;// position of the eyes relative to monster's origin.
|
||||
m_flFieldOfView = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result )
|
||||
m_MonsterState = MONSTERSTATE_NONE;
|
||||
@ -285,12 +267,6 @@ void CPinkPanther::Precache()
|
||||
|
||||
PRECACHE_MODEL( "models/pink_panther.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] );
|
||||
|
||||
|
@ -155,12 +155,12 @@ void CSawnoff::PrimaryAttack()
|
||||
if( g_pGameRules->IsMultiplayer() )
|
||||
#endif
|
||||
{
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 200, vecSrc, vecAiming, VECTOR_CONE_DM_SAWNOFF, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 30, vecSrc, vecAiming, VECTOR_CONE_DM_SAWNOFF, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
}
|
||||
else
|
||||
{
|
||||
// regular old, untouched spread.
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 200, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 30, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
}
|
||||
|
||||
PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usSingleFire, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 );
|
||||
@ -226,12 +226,12 @@ void CSawnoff::SecondaryAttack( void )
|
||||
#endif
|
||||
{
|
||||
// tuned for deathmatch
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 400, vecSrc, vecAiming, VECTOR_CONE_DM_DOUBLESAWNOFF, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 60, vecSrc, vecAiming, VECTOR_CONE_DM_DOUBLESAWNOFF, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
}
|
||||
else
|
||||
{
|
||||
// untouched default single player
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 400, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
vecDir = m_pPlayer->FireBulletsPlayer( 60, vecSrc, vecAiming, VECTOR_CONE_10DEGREES, 2048, BULLET_PLAYER_BUCKSHOT, 0, 0, m_pPlayer->pev, m_pPlayer->random_seed );
|
||||
}
|
||||
|
||||
PLAYBACK_EVENT_FULL( flags, m_pPlayer->edict(), m_usDoubleFire, 0.0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, 0, 0, 0, 0 );
|
||||
|
@ -1,3 +1,4 @@
|
||||
//fixed
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
@ -435,19 +436,19 @@ void CShrek::IdleSound( void )
|
||||
switch( RANDOM_LONG( 0, 4 ) )
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_idle1.wav", 1, SHREK_ATTN_IDLE );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_idle1.wav", 1, SHREK_ATTN_IDLE );
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_idle2.wav", 1, SHREK_ATTN_IDLE );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_idle2.wav", 1, SHREK_ATTN_IDLE );
|
||||
break;
|
||||
case 2:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_idle3.wav", 1, SHREK_ATTN_IDLE );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_idle3.wav", 1, SHREK_ATTN_IDLE );
|
||||
break;
|
||||
case 3:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_idle4.wav", 1, SHREK_ATTN_IDLE );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_idle4.wav", 1, SHREK_ATTN_IDLE );
|
||||
break;
|
||||
case 4:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_idle5.wav", 1, SHREK_ATTN_IDLE );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_idle5.wav", 1, SHREK_ATTN_IDLE );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -462,16 +463,16 @@ void CShrek::PainSound( void )
|
||||
switch( RANDOM_LONG( 0, 3 ) )
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_pain1.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "shrek/bc_pain1.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_pain2.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "shrek/bc_pain2.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
break;
|
||||
case 2:
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_pain3.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "shrek/bc_pain3.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
break;
|
||||
case 3:
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_pain4.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "shrek/bc_pain4.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -486,10 +487,10 @@ void CShrek::AlertSound( void )
|
||||
switch( RANDOM_LONG( 0, 1 ) )
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_idle1.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "shrek/bc_idle1.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "bullchicken/bc_idle2.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, "shrek/bc_idle2.wav", 1, ATTN_NORM, 0, iPitch );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -714,7 +715,10 @@ void CShrek::Precache()
|
||||
PRECACHE_SOUND( "shrek/bc_pain3.wav" );
|
||||
PRECACHE_SOUND( "shrek/bc_pain4.wav" );
|
||||
|
||||
PRECACHE_SOUND( "bullchicken/bc_attackgrowl.wav" );
|
||||
PRECACHE_SOUND( "shrek/bc_attackgrowl.wav" );
|
||||
PRECACHE_SOUND( "shrek/bc_attackgrow2.wav" );
|
||||
PRECACHE_SOUND( "shrek/bc_attackgrow3.wav" );
|
||||
|
||||
|
||||
PRECACHE_SOUND( "bullchicken/bc_acid1.wav" );
|
||||
|
||||
@ -731,13 +735,13 @@ void CShrek::DeathSound( void )
|
||||
switch( RANDOM_LONG( 0, 2 ) )
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_die1.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_die1.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_die2.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_die2.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
case 2:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_die3.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_die3.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -750,10 +754,10 @@ void CShrek::AttackSound( void )
|
||||
switch( RANDOM_LONG( 0, 1 ) )
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_attack2.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "shrek/bc_attack2.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "bullchicken/bc_attack3.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_WEAPON, "shrek/bc_attack3.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1156,13 +1160,13 @@ void CShrek::StartTask( Task_t *pTask )
|
||||
switch( RANDOM_LONG( 0, 2 ) )
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_attackgrowl.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_attackgrowl.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_attackgrowl2.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_attackgrowl2.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
case 2:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "bullchicken/bc_attackgrowl3.wav", 1, ATTN_NORM );
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "shrek/bc_attackgrowl3.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
//fixed
|
||||
//No added (Die sounds)
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
@ -37,6 +36,7 @@ public:
|
||||
void Spawn( void );
|
||||
void Precache( void );
|
||||
void SetYawSpeed( void );
|
||||
void DeathSound( void );
|
||||
int Classify( void );
|
||||
void HandleAnimEvent( MonsterEvent_t *pEvent );
|
||||
int IgnoreConditions( void );
|
||||
@ -114,6 +114,22 @@ void CSkeleton::PainSound( void )
|
||||
if( RANDOM_LONG( 0, 5 ) < 2 )
|
||||
EMIT_SOUND_DYN( ENT( pev ), CHAN_VOICE, pPainSounds[RANDOM_LONG( 0, ARRAYSIZE( pPainSounds ) - 1 )], 1.0, ATTN_NORM, 0, pitch );
|
||||
}
|
||||
void CSkeleton::DeathSound( void )
|
||||
{
|
||||
switch( RANDOM_LONG( 0, 2 ) )
|
||||
{
|
||||
case 0:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "spooky/s_die.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
case 1:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "spooky/s_die2.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
case 2:
|
||||
EMIT_SOUND( ENT( pev ), CHAN_VOICE, "spooky/s_die3.wav", 1, ATTN_NORM );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -139,9 +155,6 @@ void CSkeleton::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100;
|
||||
}
|
||||
}
|
||||
else // Play a random attack miss sound
|
||||
|
||||
if( RANDOM_LONG( 0, 1 ) )
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_LEFT:
|
||||
@ -158,8 +171,6 @@ void CSkeleton::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 100;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( RANDOM_LONG( 0, 1 ) )
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_BOTH:
|
||||
@ -174,9 +185,6 @@ void CSkeleton::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * -100;
|
||||
}
|
||||
}
|
||||
else
|
||||
\
|
||||
if( RANDOM_LONG( 0, 1 ) )
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -215,6 +223,9 @@ void CSkeleton::Precache()
|
||||
int i;
|
||||
|
||||
PRECACHE_MODEL( "models/skellington.mdl" );
|
||||
PRECACHE_SOUND( "spooky/s_die.wav" );
|
||||
PRECACHE_SOUND( "spooky/s_die2.wav" );
|
||||
PRECACHE_SOUND( "spooky/s_die3.wav" );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )
|
||||
PRECACHE_SOUND( (char *)pPainSounds[i] );
|
||||
|
@ -173,9 +173,7 @@ void Czombozo::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->punchangle.x = 5;
|
||||
pHurt->pev->velocity = pHurt->pev->velocity - gpGlobals->v_right * 100;
|
||||
}
|
||||
}
|
||||
else // Play a random attack miss sound
|
||||
if( RANDOM_LONG( 0, 1 ) )
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_LEFT:
|
||||
@ -191,9 +189,7 @@ void Czombozo::HandleAnimEvent( MonsterEvent_t *pEvent )
|
||||
pHurt->pev->punchangle.x = 5;
|
||||
pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_right * 100;
|
||||
}
|
||||
l }
|
||||
else
|
||||
if( RANDOM_LONG( 0, 1 ) )
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ZOMBIE_AE_ATTACK_BOTH:
|
||||
@ -207,10 +203,7 @@ l }
|
||||
pHurt->pev->punchangle.x = 5;
|
||||
pHurt->pev->velocity = pHurt->pev->velocity + gpGlobals->v_forward * -100;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( RANDOM_LONG( 0, 1 ) )
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user