mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-02-24 12:41:09 +03:00
Added more customizability
This commit is contained in:
parent
959af0b130
commit
99c94f058b
@ -85,9 +85,16 @@ envelopePoint_t envDefaultZombieMoanVolume[] =
|
|||||||
#define ZOMBIE_FARTHEST_PHYSICS_OBJECT 40.0*12.0
|
#define ZOMBIE_FARTHEST_PHYSICS_OBJECT 40.0*12.0
|
||||||
#define ZOMBIE_PHYSICS_SEARCH_DEPTH 100
|
#define ZOMBIE_PHYSICS_SEARCH_DEPTH 100
|
||||||
|
|
||||||
|
#ifndef MAPBASE
|
||||||
|
|
||||||
// Don't swat objects unless player is closer than this.
|
// Don't swat objects unless player is closer than this.
|
||||||
#define ZOMBIE_PLAYER_MAX_SWAT_DIST 1000
|
#define ZOMBIE_PLAYER_MAX_SWAT_DIST 1000
|
||||||
|
|
||||||
|
// The heaviest physics object that a zombie should try to swat. (kg)
|
||||||
|
#define ZOMBIE_MAX_PHYSOBJ_MASS 60
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// How much health a Zombie torso gets when a whole zombie is broken
|
// How much health a Zombie torso gets when a whole zombie is broken
|
||||||
// It's whole zombie's MAX Health * this value
|
// It's whole zombie's MAX Health * this value
|
||||||
@ -98,10 +105,6 @@ envelopePoint_t envDefaultZombieMoanVolume[] =
|
|||||||
// try to release its headcrab.
|
// try to release its headcrab.
|
||||||
#define ZOMBIE_RELEASE_HEALTH_FACTOR 0.5
|
#define ZOMBIE_RELEASE_HEALTH_FACTOR 0.5
|
||||||
|
|
||||||
//
|
|
||||||
// The heaviest physics object that a zombie should try to swat. (kg)
|
|
||||||
#define ZOMBIE_MAX_PHYSOBJ_MASS 60
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Zombie tries to get this close to a physics object's origin to swat it
|
// Zombie tries to get this close to a physics object's origin to swat it
|
||||||
#define ZOMBIE_PHYSOBJ_SWATDIST 80
|
#define ZOMBIE_PHYSOBJ_SWATDIST 80
|
||||||
@ -212,6 +215,8 @@ BEGIN_DATADESC( CNPC_BaseZombie )
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ),
|
DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ),
|
||||||
DEFINE_KEYFIELD( m_iMeleeReach, FIELD_INTEGER, "MeleeReach" ),
|
DEFINE_KEYFIELD( m_iMeleeReach, FIELD_INTEGER, "MeleeReach" ),
|
||||||
|
DEFINE_KEYFIELD( m_iMaxPlayerDistToSwat, FIELD_INTEGER, "MaxPlayerDistToSwat" ),
|
||||||
|
DEFINE_KEYFIELD( m_iMaxObjWeightToSwat, FIELD_INTEGER, "MaxObjWeightToSwat" ),
|
||||||
#else
|
#else
|
||||||
DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ),
|
DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ),
|
||||||
#endif
|
#endif
|
||||||
@ -259,6 +264,8 @@ CNPC_BaseZombie::CNPC_BaseZombie()
|
|||||||
|
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
m_iMeleeReach = 55;
|
m_iMeleeReach = 55;
|
||||||
|
m_iMaxPlayerDistToSwat = 1000;
|
||||||
|
m_iMaxObjWeightToSwat = 60;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
g_numZombies++;
|
g_numZombies++;
|
||||||
@ -300,7 +307,11 @@ bool CNPC_BaseZombie::FindNearestPhysicsObject( int iMaxMass )
|
|||||||
float dist = VectorNormalize(vecDirToEnemy);
|
float dist = VectorNormalize(vecDirToEnemy);
|
||||||
vecDirToEnemy.z = 0;
|
vecDirToEnemy.z = 0;
|
||||||
|
|
||||||
|
#ifndef MAPBASE
|
||||||
if (dist > ZOMBIE_PLAYER_MAX_SWAT_DIST)
|
if (dist > ZOMBIE_PLAYER_MAX_SWAT_DIST)
|
||||||
|
#else
|
||||||
|
if (dist > m_iMaxPlayerDistToSwat)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
// Player is too far away. Don't bother
|
// Player is too far away. Don't bother
|
||||||
// trying to swat anything at them until
|
// trying to swat anything at them until
|
||||||
@ -2159,7 +2170,11 @@ void CNPC_BaseZombie::GatherConditions( void )
|
|||||||
// between him and the object he's heading for already.
|
// between him and the object he's heading for already.
|
||||||
if( gpGlobals->curtime >= m_flNextSwatScan && (m_hPhysicsEnt == NULL) )
|
if( gpGlobals->curtime >= m_flNextSwatScan && (m_hPhysicsEnt == NULL) )
|
||||||
{
|
{
|
||||||
|
#ifdef MAPBASE
|
||||||
|
FindNearestPhysicsObject( m_iMaxObjWeightToSwat );
|
||||||
|
#else
|
||||||
FindNearestPhysicsObject( ZOMBIE_MAX_PHYSOBJ_MASS );
|
FindNearestPhysicsObject( ZOMBIE_MAX_PHYSOBJ_MASS );
|
||||||
|
#endif
|
||||||
m_flNextSwatScan = gpGlobals->curtime + 2.0;
|
m_flNextSwatScan = gpGlobals->curtime + 2.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,6 +269,8 @@ protected:
|
|||||||
|
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
int m_iMeleeReach;
|
int m_iMeleeReach;
|
||||||
|
int m_iMaxPlayerDistToSwat;
|
||||||
|
int m_iMaxObjWeightToSwat;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool m_bHeadShot; // Used to determine the survival of our crab beyond our death.
|
bool m_bHeadShot; // Used to determine the survival of our crab beyond our death.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user