Browse Source

Update grapple

opforfixed
Roman Chistokhodov 5 years ago
parent
commit
676267f45d
  1. 5
      cl_dll/hl/hl_weapons.cpp
  2. 2
      dlls/agrunt.cpp
  3. 2
      dlls/barnacle.cpp
  4. 2
      dlls/bigmomma.cpp
  5. 4
      dlls/bullsquid.h
  6. 11
      dlls/cbase.h
  7. 2
      dlls/gargantua.cpp
  8. 883
      dlls/gearbox/grapple.cpp
  9. 230
      dlls/gearbox/grapple_tonguetip.cpp
  10. 51
      dlls/gearbox/grapple_tonguetip.h
  11. 2
      dlls/gearbox/pitdrone.cpp
  12. 4
      dlls/gearbox/voltigore.cpp
  13. 4
      dlls/headcrab.h
  14. 4
      dlls/hgrunt.h
  15. 2
      dlls/houndeye.cpp
  16. 2
      dlls/ichthyosaur.cpp
  17. 2
      dlls/islave.cpp
  18. 2
      dlls/leech.cpp
  19. 2
      dlls/squeakgrenade.cpp
  20. 1
      dlls/talkmonster.h
  21. 2
      dlls/tentacle.cpp
  22. 16
      dlls/weapons.cpp
  23. 97
      dlls/weapons.h
  24. 2
      dlls/zombie.h

5
cl_dll/hl/hl_weapons.cpp

@ -69,7 +69,6 @@ CTripmine g_Tripmine; @@ -69,7 +69,6 @@ CTripmine g_Tripmine;
CSqueak g_Snark;
CDisplacer g_Displacer;
CEagle g_Eagle;
CGrapple g_Grapple;
CKnife g_Knife;
CM249 g_M249;
CPenguin g_Penguin;
@ -628,7 +627,6 @@ void HUD_InitClientWeapons( void ) @@ -628,7 +627,6 @@ void HUD_InitClientWeapons( void )
HUD_PrepEntity( &g_Snark, &player );
HUD_PrepEntity( &g_Displacer, &player );
HUD_PrepEntity( &g_Eagle, &player );
HUD_PrepEntity( &g_Grapple, &player );
HUD_PrepEntity( &g_Knife, &player );
HUD_PrepEntity( &g_M249, &player );
HUD_PrepEntity( &g_Penguin, &player );
@ -744,9 +742,6 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm @@ -744,9 +742,6 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
case WEAPON_DISPLACER:
pWeapon = &g_Displacer;
break;
case WEAPON_GRAPPLE:
pWeapon = &g_Grapple;
break;
case WEAPON_EAGLE:
pWeapon = &g_Eagle;
break;

2
dlls/agrunt.cpp

@ -102,6 +102,8 @@ public: @@ -102,6 +102,8 @@ public:
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_LARGE; }
static const char *pAttackHitSounds[];
static const char *pAttackMissSounds[];
static const char *pAttackSounds[];

2
dlls/barnacle.cpp

@ -47,6 +47,8 @@ public: @@ -47,6 +47,8 @@ public:
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_FIXED; }
float m_flAltitude;
float m_flCachedLength; // tongue cached length
float m_flKillVictimTime;

2
dlls/bigmomma.cpp

@ -287,6 +287,8 @@ public: @@ -287,6 +287,8 @@ public:
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_LARGE; }
static const char *pChildDieSounds[];
static const char *pSackSounds[];
static const char *pDeathSounds[];

4
dlls/bullsquid.h

@ -73,9 +73,11 @@ public: @@ -73,9 +73,11 @@ public:
int Save(CSave &save);
int Restore(CRestore &restore);
CUSTOM_SCHEDULES;
CUSTOM_SCHEDULES
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_MEDIUM; }
BOOL m_fCanThreatDisplay;// this is so the squid only does the "I see a headcrab!" dance one time.
float m_flLastHurtTime;// we keep track of this, because if something hurts a squid, it will forget about its love of headcrabs for a while.

11
dlls/cbase.h

@ -134,6 +134,15 @@ public: @@ -134,6 +134,15 @@ public:
CBaseEntity *operator ->();
};
enum GrappleTarget
{
GRAPPLE_NOT_A_TARGET = 0,
GRAPPLE_SMALL = 1,
GRAPPLE_MEDIUM = 2,
GRAPPLE_LARGE = 3,
GRAPPLE_FIXED = 4,
};
//
// Base Entity. All entity types derive from this
//
@ -356,6 +365,8 @@ public: @@ -356,6 +365,8 @@ public:
virtual BOOL FVisible( CBaseEntity *pEntity );
virtual BOOL FVisible( const Vector &vecOrigin );
virtual int SizeForGrapple() { return GRAPPLE_NOT_A_TARGET; }
//We use this variables to store each ammo count.
int ammo_9mm;
int ammo_357;

2
dlls/gargantua.cpp

@ -244,6 +244,8 @@ public: @@ -244,6 +244,8 @@ public:
CUSTOM_SCHEDULES
virtual int SizeForGrapple() { return GRAPPLE_LARGE; }
private:
static const char *pAttackHitSounds[];
static const char *pBeamAttackSounds[];

883
dlls/gearbox/grapple.cpp

File diff suppressed because it is too large Load Diff

230
dlls/gearbox/grapple_tonguetip.cpp

@ -23,133 +23,193 @@ @@ -23,133 +23,193 @@
#include "gamerules.h"
#include "grapple_tonguetip.h"
LINK_ENTITY_TO_CLASS(grapple_tonguetip, CGrappleTonguetip);
LINK_ENTITY_TO_CLASS( grapple_tip, CBarnacleGrappleTip )
TYPEDESCRIPTION CGrappleTonguetip::m_SaveData[] =
void CBarnacleGrappleTip::Precache()
{
DEFINE_FIELD(CGrappleTonguetip, m_pMyGrappler, FIELD_CLASSPTR),
};
IMPLEMENT_SAVERESTORE(CGrappleTonguetip, CBaseEntity);
PRECACHE_MODEL( "models/shock_effect.mdl" );
}
//=========================================================
// Purpose: Spawn
//=========================================================
void CGrappleTonguetip::Spawn(void)
void CBarnacleGrappleTip::Spawn()
{
pev->movetype = MOVETYPE_TOSS;
pev->classname = MAKE_STRING("grapple_tonguetip");
Precache();
pev->movetype = MOVETYPE_FLY;
pev->solid = SOLID_BBOX;
pev->rendermode = kRenderTransTexture;
pev->renderamt = 0;
pev->gravity = 0.01;
SET_MODEL(ENT(pev), "models/v_bgrap_tonguetip.mdl");
SET_MODEL( ENT(pev), "models/shock_effect.mdl" );
UTIL_SetSize(pev, Vector(0, 0, 0), Vector(0, 0, 0));
UTIL_SetSize( pev, Vector(0, 0, 0), Vector(0, 0, 0) );
SetTouch(&CGrappleTonguetip::TipTouch);
}
UTIL_SetOrigin( pev, pev->origin );
//=========================================================
// Purpose: CreateTip
//=========================================================
CGrappleTonguetip* CGrappleTonguetip::CreateTip(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity)
{
CGrappleTonguetip* pTonguetip = GetClassPtr((CGrappleTonguetip *)NULL);
pTonguetip->Spawn();
SetThink( &CBarnacleGrappleTip::FlyThink );
SetTouch( &CBarnacleGrappleTip::TongueTouch );
UTIL_SetOrigin(pTonguetip->pev, vecStart);
pTonguetip->pev->velocity = vecVelocity;
pTonguetip->pev->owner = ENT(pevOwner);
pTonguetip->m_pMyGrappler = GetClassPtr((CGrapple*)pevOwner);
pTonguetip->SetThink(&CGrappleTonguetip::FlyThink);
pTonguetip->pev->nextthink = gpGlobals->time + 0.1;
Vector vecAngles = pev->angles;
return pTonguetip;
}
vecAngles.x -= 30.0;
//=========================================================
// Purpose: FlyThink
//=========================================================
void CGrappleTonguetip::FlyThink(void)
{
ALERT(at_console, "FlyThink\n");
pev->angles = vecAngles;
pev->nextthink = gpGlobals->time + 0.1f;
}
UTIL_MakeVectors( pev->angles );
//=========================================================
// Purpose: HitThink
//=========================================================
void CGrappleTonguetip::HitThink(void)
{
ALERT(at_console, "HitThink\n");
vecAngles.x = -( 30.0 + vecAngles.x );
pev->nextthink = gpGlobals->time + 0.1f;
pev->velocity = g_vecZero;
pev->gravity = 1.0;
pev->nextthink = gpGlobals->time + 0.02;
m_bIsStuck = FALSE;
m_bMissed = FALSE;
}
//=========================================================
// Purpose: TipTouch
//=========================================================
void CGrappleTonguetip::TipTouch(CBaseEntity *pOther)
void CBarnacleGrappleTip::FlyThink()
{
// Do not collide with the owner.
if (ENT(pOther->pev) == pev->owner || (ENT(pOther->pev) == VARS(pev->owner)->owner))
return;
UTIL_MakeAimVectors( pev->angles );
ALERT(at_console, "TipTouch\n");
pev->angles = UTIL_VecToAngles( gpGlobals->v_forward );
TraceResult tr;
UTIL_TraceLine(pev->origin, pev->origin + pev->velocity * 10, dont_ignore_monsters, ENT(pev), &tr);
const float flNewVel = ( ( pev->velocity.Length() * 0.8 ) + 400.0 );
pev->velocity = Vector(0, 0, 0);
pev->velocity = pev->velocity * 0.2 + ( flNewVel * gpGlobals->v_forward );
int content = UTIL_PointContents(tr.vecEndPos);
int hitFlags = pOther->pev->flags;
if( !g_pGameRules->IsMultiplayer() )
{
//Note: the old grapple had a maximum velocity of 1600. - Solokiller
if( pev->velocity.Length() > 750.0 )
{
pev->velocity = pev->velocity.Normalize() * 750.0;
}
}
else
{
//TODO: should probably clamp at sv_maxvelocity to prevent the tip from going off course. - Solokiller
if( pev->velocity.Length() > 2000.0 )
{
pev->velocity = pev->velocity.Normalize() * 2000.0;
}
}
m_pMyGrappler->m_fTipHit = TRUE;
m_pMyGrappler->m_iHitFlags = hitFlags;
pev->nextthink = gpGlobals->time + 0.02;
}
if (hitFlags & (FL_CLIENT | FL_MONSTER))
void CBarnacleGrappleTip::OffsetThink()
{
//Nothing
}
void CBarnacleGrappleTip::TongueTouch( CBaseEntity* pOther )
{
if( !pOther )
{
// Set player attached flag.
if (pOther->IsPlayer())
((CBasePlayer*)pOther)->m_afPhysicsFlags |= PFLAG_ATTACHED;
targetClass = GRAPPLE_NOT_A_TARGET;
m_bMissed = TRUE;
}
else
{
if( pOther->IsPlayer() )
{
targetClass = GRAPPLE_MEDIUM;
pev->movetype = MOVETYPE_FOLLOW;
pev->aiment = ENT(pOther->pev);
m_hGrappleTarget = pOther;
m_pMyGrappler->OnTongueTipHitEntity(pOther);
m_bIsStuck = TRUE;
}
else
{
pev->velocity = Vector(0, 0, 0);
pev->movetype = MOVETYPE_NONE;
pev->gravity = 0.0f;
targetClass = CheckTarget( pOther );
m_pMyGrappler->OnTongueTipHitSurface(tr.vecEndPos);
if( targetClass != GRAPPLE_NOT_A_TARGET )
{
m_bIsStuck = TRUE;
}
else
{
m_bMissed = TRUE;
}
}
}
pev->velocity = g_vecZero;
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "weapons/bgrapple_impact.wav", 1, ATTN_NORM, 0, 100);
m_GrappleType = targetClass;
SetThink( &CBarnacleGrappleTip::OffsetThink );
pev->nextthink = gpGlobals->time + 0.02;
SetTouch( NULL );
SetThink(&CGrappleTonguetip::HitThink);
pev->nextthink = gpGlobals->time + 0.1f;
}
void CGrappleTonguetip::PreRemoval(void)
int CBarnacleGrappleTip::CheckTarget( CBaseEntity* pTarget )
{
if (pev->aiment != NULL)
if( !pTarget )
return GRAPPLE_NOT_A_TARGET;
if( pTarget->IsPlayer() )
{
CBaseEntity* pEnt = GetClassPtr((CBaseEntity*)VARS(pev->aiment));
if (pEnt && pEnt->IsPlayer())
m_hGrappleTarget = pTarget;
return pTarget->SizeForGrapple();
}
Vector vecStart = pev->origin;
Vector vecEnd = pev->origin + pev->velocity * 1024.0;
TraceResult tr;
UTIL_TraceLine( vecStart, vecEnd, ignore_monsters, edict(), &tr );
CBaseEntity* pHit = Instance( tr.pHit );
/* if( !pHit )
pHit = CWorld::GetInstance();*/
float rgfl1[3];
float rgfl2[3];
const char *pTexture;
vecStart.CopyToArray(rgfl1);
vecEnd.CopyToArray(rgfl2);
if (pHit)
pTexture = TRACE_TEXTURE(ENT(pHit->pev), rgfl1, rgfl2);
else
pTexture = TRACE_TEXTURE(ENT(0), rgfl1, rgfl2);
bool bIsFixed = false;
if( pTexture && strnicmp( pTexture, "xeno_grapple", 12 ) == 0 )
{
bIsFixed = true;
}
else if (pTarget->SizeForGrapple() != GRAPPLE_NOT_A_TARGET)
{
// Remove attached flag of the target entity.
((CBasePlayer*)pEnt)->m_afPhysicsFlags &= ~PFLAG_ATTACHED;
if (pTarget->SizeForGrapple() == GRAPPLE_FIXED) {
bIsFixed = true;
} else {
m_hGrappleTarget = pTarget;
m_vecOriginOffset = pev->origin - pTarget->pev->origin;
return pTarget->SizeForGrapple();
}
}
CBaseEntity::PreRemoval();
if( bIsFixed )
{
m_hGrappleTarget = pTarget;
m_vecOriginOffset = g_vecZero;
return GRAPPLE_FIXED;
}
return GRAPPLE_NOT_A_TARGET;
}
void CBarnacleGrappleTip::SetPosition( Vector vecOrigin, Vector vecAngles, CBaseEntity* pOwner )
{
UTIL_SetOrigin( pev, vecOrigin );
pev->angles = vecAngles;
pev->owner = pOwner->edict();
}

51
dlls/gearbox/grapple_tonguetip.h

@ -16,32 +16,47 @@ @@ -16,32 +16,47 @@
#ifndef GRAPPLE_TONGUETIP_H
#define GRAPPLE_TONGUETIP_H
class CGrapple;
//
//
//
class CGrappleTonguetip : public CBaseEntity
class CBarnacleGrappleTip : public CBaseEntity
{
public:
#ifndef CLIENT_DLL
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
/* virtual int Save( CSave &save );
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
#endif
*/
int targetClass;
void Precache();
void Spawn();
void FlyThink();
void OffsetThink();
void TongueTouch( CBaseEntity* pOther );
int CheckTarget( CBaseEntity* pTarget );
void Spawn(void);
void FlyThink(void);
void HitThink(void);
void TipTouch(CBaseEntity* pOther);
void PreRemoval(void);
void SetPosition( Vector vecOrigin, Vector vecAngles, CBaseEntity* pOwner );
CGrapple* m_pMyGrappler;
int GetGrappleType() const { return m_GrappleType; }
bool IsStuck() const { return m_bIsStuck; }
bool HasMissed() const { return m_bMissed; }
#ifndef CLIENT_DLL
EHANDLE& GetGrappleTarget() { return m_hGrappleTarget; }
void SetGrappleTarget( CBaseEntity* pTarget )
{
m_hGrappleTarget = pTarget;
}
#endif
private:
static CGrappleTonguetip* CreateTip(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity);
friend class CGrapple;
int m_GrappleType;
bool m_bIsStuck;
bool m_bMissed;
#ifndef CLIENT_DLL
EHANDLE m_hGrappleTarget;
#endif
Vector m_vecOriginOffset;
};
#endif // GRAPPLE_TONGUETIP_H

2
dlls/gearbox/pitdrone.cpp

@ -237,6 +237,8 @@ public: @@ -237,6 +237,8 @@ public:
void GibMonster();
CUSTOM_SCHEDULES
virtual int SizeForGrapple() { return GRAPPLE_MEDIUM; }
float m_flLastHurtTime;
float m_flNextSpitTime;// last time the PitDrone used the spit attack.
float m_flNextFlinch;

4
dlls/gearbox/voltigore.cpp

@ -336,6 +336,8 @@ public: @@ -336,6 +336,8 @@ public:
CUSTOM_SCHEDULES
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_LARGE; }
float m_flNextZapTime; // last time the voltigore used the spit attack.
BOOL m_fShouldUpdateBeam;
CBeam* m_pBeam[3];
@ -1209,6 +1211,8 @@ public: @@ -1209,6 +1211,8 @@ public:
void GibMonster();
Schedule_t* GetSchedule();
Schedule_t* GetScheduleOfType(int Type);
virtual int SizeForGrapple() { return GRAPPLE_SMALL; }
};
LINK_ENTITY_TO_CLASS(monster_alien_babyvoltigore, CBabyVoltigore)

4
dlls/headcrab.h

@ -46,7 +46,9 @@ public: @@ -46,7 +46,9 @@ public:
virtual float GetSoundVolue(void) { return 1.0; }
Schedule_t* GetScheduleOfType(int Type);
CUSTOM_SCHEDULES;
CUSTOM_SCHEDULES
virtual int SizeForGrapple() { return GRAPPLE_SMALL; }
static const char *pIdleSounds[];
static const char *pAlertSounds[];

4
dlls/hgrunt.h

@ -60,9 +60,11 @@ public: @@ -60,9 +60,11 @@ public:
virtual BOOL FOkToSpeak(void);
void JustSpoke(void);
CUSTOM_SCHEDULES;
CUSTOM_SCHEDULES
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_MEDIUM; }
// checking the feasibility of a grenade toss is kind of costly, so we do it every couple of seconds,
// not every server frame.
float m_flNextGrenadeCheck;

2
dlls/houndeye.cpp

@ -105,6 +105,8 @@ public: @@ -105,6 +105,8 @@ public:
CUSTOM_SCHEDULES
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_MEDIUM; }
int m_iSpriteTexture;
BOOL m_fAsleep;// some houndeyes sleep in idle mode if this is set, the houndeye is lying down
BOOL m_fDontBlink;// don't try to open/close eye if this bit is set!

2
dlls/ichthyosaur.cpp

@ -90,6 +90,8 @@ public: @@ -90,6 +90,8 @@ public:
float FlPitchDiff( void );
float ChangePitch( int speed );
virtual int SizeForGrapple() { return GRAPPLE_LARGE; }
Vector m_SaveVelocity;
float m_idealDist;

2
dlls/islave.cpp

@ -63,6 +63,8 @@ public: @@ -63,6 +63,8 @@ public:
void Killed( entvars_t *pevAttacker, int iGib );
virtual int SizeForGrapple() { return GRAPPLE_MEDIUM; }
void StartTask( Task_t *pTask );
Schedule_t *GetSchedule( void );
Schedule_t *GetScheduleOfType( int Type );

2
dlls/leech.cpp

@ -112,6 +112,8 @@ public: @@ -112,6 +112,8 @@ public:
static const char *pAttackSounds[];
static const char *pAlertSounds[];
virtual int SizeForGrapple() { return GRAPPLE_SMALL; }
private:
// UNDONE: Remove unused boid vars, do group behavior
float m_flTurning;// is this boid turning?

2
dlls/squeakgrenade.cpp

@ -59,6 +59,8 @@ class CSqueakGrenade : public CGrenade @@ -59,6 +59,8 @@ class CSqueakGrenade : public CGrenade
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_SMALL; }
static float m_flNextBounceSoundTime;
// CBaseEntity *m_pTarget;

1
dlls/talkmonster.h

@ -154,6 +154,7 @@ public: @@ -154,6 +154,7 @@ public:
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
virtual int SizeForGrapple() { return GRAPPLE_MEDIUM; }
static const char *m_szFriends[TLK_CFRIENDS]; // array of friend names
static float g_talkWaitTime;

2
dlls/tentacle.cpp

@ -74,6 +74,8 @@ public: @@ -74,6 +74,8 @@ public:
int Classify( void );
virtual int SizeForGrapple() { return GRAPPLE_FIXED; }
int Level( float dz );
int MyLevel( void );
float MyHeight( void );

16
dlls/weapons.cpp

@ -371,7 +371,7 @@ void W_Precache( void ) @@ -371,7 +371,7 @@ void W_Precache( void )
UTIL_PrecacheOtherWeapon( "weapon_displacer" );
UTIL_PrecacheOtherWeapon( "weapon_eagle" );
UTIL_PrecacheOtherWeapon( "weapon_grapple" );
UTIL_PrecacheOther( "grapple_tonguetip" );
UTIL_PrecacheOther( "grapple_tip" );
UTIL_PrecacheOtherWeapon( "weapon_knife" );
UTIL_PrecacheOtherWeapon( "weapon_m249" );
UTIL_PrecacheOther( "ammo_556" );
@ -1687,17 +1687,13 @@ TYPEDESCRIPTION CEagle::m_SaveData[] = @@ -1687,17 +1687,13 @@ TYPEDESCRIPTION CEagle::m_SaveData[] =
IMPLEMENT_SAVERESTORE( CEagle, CBasePlayerWeapon )
TYPEDESCRIPTION CGrapple::m_SaveData[] =
TYPEDESCRIPTION CBarnacleGrapple::m_SaveData[] =
{
DEFINE_FIELD( CGrapple, m_iFirestate, FIELD_INTEGER ),
DEFINE_FIELD( CGrapple, m_iHitFlags, FIELD_INTEGER ),
DEFINE_FIELD( CGrapple, m_fTipHit, FIELD_BOOLEAN ),
DEFINE_FIELD( CGrapple, m_pTongueTip, FIELD_CLASSPTR ),
DEFINE_FIELD( CGrapple, m_pBeam, FIELD_CLASSPTR ),
DEFINE_FIELD( CGrapple, m_flNextPullSoundTime, FIELD_TIME ),
DEFINE_FIELD( CGrapple, m_fPlayPullSound, FIELD_BOOLEAN ),
DEFINE_FIELD( CBarnacleGrapple, m_pBeam, FIELD_CLASSPTR ),
DEFINE_FIELD( CBarnacleGrapple, m_flShootTime, FIELD_TIME ),
DEFINE_FIELD( CBarnacleGrapple, m_fireState, FIELD_INTEGER ),
};
IMPLEMENT_SAVERESTORE( CGrapple, CBasePlayerWeapon )
IMPLEMENT_SAVERESTORE( CBarnacleGrapple, CBasePlayerWeapon )
TYPEDESCRIPTION CM249::m_SaveData[] =
{

97
dlls/weapons.h

@ -1145,92 +1145,57 @@ private: @@ -1145,92 +1145,57 @@ private:
unsigned short m_usEagle;
};
class CGrappleTonguetip;
class CBarnacleGrappleTip;
class CGrapple : public CBasePlayerWeapon
class CBarnacleGrapple : public CBasePlayerWeapon
{
public:
#ifndef CLIENT_DLL
int Save(CSave &save);
int Restore(CRestore &restore);
virtual int Save( CSave &save );
virtual int Restore( CRestore &restore );
static TYPEDESCRIPTION m_SaveData[];
#endif
enum FireState
{
OFF = 0,
CHARGE = 1
};
void Spawn(void);
void Precache(void);
void Precache( void );
void Spawn( void );
int iItemSlot(void) { return 1; }
int GetItemInfo(ItemInfo *p);
void EndAttack( void );
void PrimaryAttack(void);
BOOL Deploy(void);
void Holster(int skiplocal = 0);
void WeaponIdle(void);
void ItemPostFrame(void);
int GetItemInfo(ItemInfo *p);
int AddToPlayer( CBasePlayer* pPlayer );
BOOL Deploy();
void Holster( int skiplocal /* = 0 */ );
void WeaponIdle( void );
void PrimaryAttack( void );
virtual BOOL ShouldWeaponIdle(void) { return TRUE; }
void Fire( Vector vecOrigin, Vector vecDir );
void CreateEffect( void );
void UpdateEffect( void );
void DestroyEffect( void );
virtual BOOL UseDecrement(void)
{
#if defined( CLIENT_WEAPONS )
return TRUE;
#else
return FALSE;
#endif
}
void Fire(void);
void FireWait(void);
void FireReach(void);
void FireTravel(void);
void FireRelease(void);
void Fire2(void);
void OnTongueTipHitSurface( const Vector& vecTarget );
void OnTongueTipHitEntity( CBaseEntity* pEntity );
void StartPull( void );
void StopPull( void );
void Pull( void );
const char* MyWModel() { return "models/w_bgrap.mdl"; }
BOOL IsTongueColliding( const Vector& vecShootOrigin, const Vector& vecTipPos );
void CheckFireEligibility( void );
BOOL CheckTargetProximity( void );
void CreateTongueTip( void );
void DestroyTongueTip( void );
void UpdateTongueTip( void );
void CreateBeam( CBaseEntity* pTongueTip );
void DestroyBeam( void );
void UpdateBeam( void );
private:
CBarnacleGrappleTip* m_pTip;
void StartPullSound( void );
void UpdatePullSound( void );
void ResetPullSound( void );
CBeam* m_pBeam;
BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted);
float m_flShootTime;
float m_flDamageTime;
enum GRAPPLE_FIRESTATE
{
FIRESTATE_NONE = 0,
FIRESTATE_FIRE,
FIRESTATE_FIRE2,
FIRESTATE_WAIT,
FIRESTATE_REACH,
FIRESTATE_TRAVEL,
FIRESTATE_RELEASE,
};
int m_iFirestate;
int m_iHitFlags;
BOOL m_fTipHit;
CGrappleTonguetip* m_pTongueTip;
CBeam* m_pBeam;
float m_flNextPullSoundTime;
BOOL m_fPlayPullSound;
private:
bool m_bGrappling;
bool m_bMissed;
bool m_bMomentaryStuck;
};

2
dlls/zombie.h

@ -44,4 +44,6 @@ public: @@ -44,4 +44,6 @@ public:
virtual BOOL CheckRangeAttack1( float flDot, float flDist ) { return FALSE; }
virtual BOOL CheckRangeAttack2( float flDot, float flDist ) { return FALSE; }
virtual int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
virtual int SizeForGrapple() { return GRAPPLE_MEDIUM; }
};

Loading…
Cancel
Save