Added Melee attack keyvalue

This commit is contained in:
Wikot235 2024-07-27 23:49:31 +02:00
parent 471a840ed9
commit 41233cb475
2 changed files with 4 additions and 3 deletions

View File

@ -211,6 +211,7 @@ BEGIN_DATADESC( CNPC_BaseZombie )
DEFINE_FIELD( m_fIsTorso, FIELD_BOOLEAN ), DEFINE_FIELD( m_fIsTorso, FIELD_BOOLEAN ),
#ifdef MAPBASE #ifdef MAPBASE
DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ), DEFINE_KEYFIELD( m_fIsHeadless, FIELD_BOOLEAN, "Headless" ),
DEFINE_KEYFIELD( m_flMeleeReach, FIELD_FLOAT, "MeleeReach" ),
#else #else
DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ), DEFINE_FIELD( m_fIsHeadless, FIELD_BOOLEAN ),
#endif #endif

View File

@ -20,8 +20,6 @@
#define ENVELOPE_CONTROLLER (CSoundEnvelopeController::GetController()) #define ENVELOPE_CONTROLLER (CSoundEnvelopeController::GetController())
#define ZOMBIE_MELEE_REACH 55
extern int AE_ZOMBIE_ATTACK_RIGHT; extern int AE_ZOMBIE_ATTACK_RIGHT;
extern int AE_ZOMBIE_ATTACK_LEFT; extern int AE_ZOMBIE_ATTACK_LEFT;
extern int AE_ZOMBIE_ATTACK_BOTH; extern int AE_ZOMBIE_ATTACK_BOTH;
@ -141,7 +139,7 @@ public:
} }
int MeleeAttack1Conditions ( float flDot, float flDist ); int MeleeAttack1Conditions ( float flDot, float flDist );
virtual float GetClawAttackRange() const { return ZOMBIE_MELEE_REACH; } virtual float GetClawAttackRange() const { return m_flMeleeReach; }
// No range attacks // No range attacks
int RangeAttack1Conditions ( float flDot, float flDist ) { return( 0 ); } int RangeAttack1Conditions ( float flDot, float flDist ) { return( 0 ); }
@ -257,6 +255,8 @@ protected:
float m_flNextFlinch; float m_flNextFlinch;
float m_flMeleeReach;
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.
// //