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. 929
      dlls/gearbox/grapple.cpp
  9. 236
      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;
CSqueak g_Snark; CSqueak g_Snark;
CDisplacer g_Displacer; CDisplacer g_Displacer;
CEagle g_Eagle; CEagle g_Eagle;
CGrapple g_Grapple;
CKnife g_Knife; CKnife g_Knife;
CM249 g_M249; CM249 g_M249;
CPenguin g_Penguin; CPenguin g_Penguin;
@ -628,7 +627,6 @@ void HUD_InitClientWeapons( void )
HUD_PrepEntity( &g_Snark, &player ); HUD_PrepEntity( &g_Snark, &player );
HUD_PrepEntity( &g_Displacer, &player ); HUD_PrepEntity( &g_Displacer, &player );
HUD_PrepEntity( &g_Eagle, &player ); HUD_PrepEntity( &g_Eagle, &player );
HUD_PrepEntity( &g_Grapple, &player );
HUD_PrepEntity( &g_Knife, &player ); HUD_PrepEntity( &g_Knife, &player );
HUD_PrepEntity( &g_M249, &player ); HUD_PrepEntity( &g_M249, &player );
HUD_PrepEntity( &g_Penguin, &player ); HUD_PrepEntity( &g_Penguin, &player );
@ -744,9 +742,6 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
case WEAPON_DISPLACER: case WEAPON_DISPLACER:
pWeapon = &g_Displacer; pWeapon = &g_Displacer;
break; break;
case WEAPON_GRAPPLE:
pWeapon = &g_Grapple;
break;
case WEAPON_EAGLE: case WEAPON_EAGLE:
pWeapon = &g_Eagle; pWeapon = &g_Eagle;
break; break;

2
dlls/agrunt.cpp

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

2
dlls/barnacle.cpp

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

2
dlls/bigmomma.cpp

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

4
dlls/bullsquid.h

@ -73,9 +73,11 @@ public:
int Save(CSave &save); int Save(CSave &save);
int Restore(CRestore &restore); int Restore(CRestore &restore);
CUSTOM_SCHEDULES; CUSTOM_SCHEDULES
static TYPEDESCRIPTION m_SaveData[]; 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. 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. 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:
CBaseEntity *operator ->(); 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 // Base Entity. All entity types derive from this
// //
@ -356,6 +365,8 @@ public:
virtual BOOL FVisible( CBaseEntity *pEntity ); virtual BOOL FVisible( CBaseEntity *pEntity );
virtual BOOL FVisible( const Vector &vecOrigin ); virtual BOOL FVisible( const Vector &vecOrigin );
virtual int SizeForGrapple() { return GRAPPLE_NOT_A_TARGET; }
//We use this variables to store each ammo count. //We use this variables to store each ammo count.
int ammo_9mm; int ammo_9mm;
int ammo_357; int ammo_357;

2
dlls/gargantua.cpp

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

929
dlls/gearbox/grapple.cpp

File diff suppressed because it is too large Load Diff

236
dlls/gearbox/grapple_tonguetip.cpp

@ -23,133 +23,193 @@
#include "gamerules.h" #include "gamerules.h"
#include "grapple_tonguetip.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), PRECACHE_MODEL( "models/shock_effect.mdl" );
}; }
IMPLEMENT_SAVERESTORE(CGrappleTonguetip, CBaseEntity);
//========================================================= void CBarnacleGrappleTip::Spawn()
// Purpose: Spawn
//=========================================================
void CGrappleTonguetip::Spawn(void)
{ {
pev->movetype = MOVETYPE_TOSS; Precache();
pev->classname = MAKE_STRING("grapple_tonguetip");
pev->movetype = MOVETYPE_FLY;
pev->solid = SOLID_BBOX; 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 );
}
//========================================================= SetThink( &CBarnacleGrappleTip::FlyThink );
// Purpose: CreateTip SetTouch( &CBarnacleGrappleTip::TongueTouch );
//=========================================================
CGrappleTonguetip* CGrappleTonguetip::CreateTip(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity)
{
CGrappleTonguetip* pTonguetip = GetClassPtr((CGrappleTonguetip *)NULL);
pTonguetip->Spawn();
UTIL_SetOrigin(pTonguetip->pev, vecStart); Vector vecAngles = pev->angles;
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;
return pTonguetip; vecAngles.x -= 30.0;
}
//========================================================= pev->angles = vecAngles;
// Purpose: FlyThink
//=========================================================
void CGrappleTonguetip::FlyThink(void)
{
ALERT(at_console, "FlyThink\n");
pev->nextthink = gpGlobals->time + 0.1f; UTIL_MakeVectors( pev->angles );
}
//========================================================= vecAngles.x = -( 30.0 + vecAngles.x );
// Purpose: HitThink
//=========================================================
void CGrappleTonguetip::HitThink(void)
{
ALERT(at_console, "HitThink\n");
pev->nextthink = gpGlobals->time + 0.1f; pev->velocity = g_vecZero;
}
//========================================================= pev->gravity = 1.0;
// Purpose: TipTouch
//=========================================================
void CGrappleTonguetip::TipTouch(CBaseEntity *pOther)
{
// Do not collide with the owner.
if (ENT(pOther->pev) == pev->owner || (ENT(pOther->pev) == VARS(pev->owner)->owner))
return;
ALERT(at_console, "TipTouch\n"); pev->nextthink = gpGlobals->time + 0.02;
TraceResult tr; m_bIsStuck = FALSE;
UTIL_TraceLine(pev->origin, pev->origin + pev->velocity * 10, dont_ignore_monsters, ENT(pev), &tr); m_bMissed = FALSE;
}
pev->velocity = Vector(0, 0, 0); void CBarnacleGrappleTip::FlyThink()
{
UTIL_MakeAimVectors( pev->angles );
pev->angles = UTIL_VecToAngles( gpGlobals->v_forward );
int content = UTIL_PointContents(tr.vecEndPos); const float flNewVel = ( ( pev->velocity.Length() * 0.8 ) + 400.0 );
int hitFlags = pOther->pev->flags;
m_pMyGrappler->m_fTipHit = TRUE; pev->velocity = pev->velocity * 0.2 + ( flNewVel * gpGlobals->v_forward );
m_pMyGrappler->m_iHitFlags = hitFlags;
if (hitFlags & (FL_CLIENT | FL_MONSTER)) if( !g_pGameRules->IsMultiplayer() )
{ {
// Set player attached flag. //Note: the old grapple had a maximum velocity of 1600. - Solokiller
if (pOther->IsPlayer()) if( pev->velocity.Length() > 750.0 )
((CBasePlayer*)pOther)->m_afPhysicsFlags |= PFLAG_ATTACHED; {
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;
}
}
pev->movetype = MOVETYPE_FOLLOW; pev->nextthink = gpGlobals->time + 0.02;
pev->aiment = ENT(pOther->pev); }
m_pMyGrappler->OnTongueTipHitEntity(pOther); void CBarnacleGrappleTip::OffsetThink()
{
//Nothing
}
void CBarnacleGrappleTip::TongueTouch( CBaseEntity* pOther )
{
if( !pOther )
{
targetClass = GRAPPLE_NOT_A_TARGET;
m_bMissed = TRUE;
} }
else else
{ {
pev->velocity = Vector(0, 0, 0); if( pOther->IsPlayer() )
pev->movetype = MOVETYPE_NONE; {
pev->gravity = 0.0f; targetClass = GRAPPLE_MEDIUM;
m_hGrappleTarget = pOther;
m_pMyGrappler->OnTongueTipHitSurface(tr.vecEndPos); m_bIsStuck = TRUE;
}
else
{
targetClass = CheckTarget( pOther );
if( targetClass != GRAPPLE_NOT_A_TARGET )
{
m_bIsStuck = TRUE;
}
else
{
m_bMissed = TRUE;
}
}
} }
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "weapons/bgrapple_impact.wav", 1, ATTN_NORM, 0, 100); pev->velocity = g_vecZero;
m_GrappleType = targetClass;
SetThink( &CBarnacleGrappleTip::OffsetThink );
pev->nextthink = gpGlobals->time + 0.02;
SetTouch( NULL ); 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)); m_hGrappleTarget = pTarget;
if (pEnt && pEnt->IsPlayer())
{ return pTarget->SizeForGrapple();
// Remove attached flag of the target entity. }
((CBasePlayer*)pEnt)->m_afPhysicsFlags &= ~PFLAG_ATTACHED;
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)
{
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 @@
#ifndef GRAPPLE_TONGUETIP_H #ifndef GRAPPLE_TONGUETIP_H
#define GRAPPLE_TONGUETIP_H #define GRAPPLE_TONGUETIP_H
class CGrapple; class CBarnacleGrappleTip : public CBaseEntity
//
//
//
class CGrappleTonguetip : public CBaseEntity
{ {
public: public:
#ifndef CLIENT_DLL /* virtual int Save( CSave &save );
virtual int Save(CSave &save); virtual int Restore( CRestore &restore );
virtual int Restore(CRestore &restore);
static TYPEDESCRIPTION m_SaveData[]; 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 SetPosition( Vector vecOrigin, Vector vecAngles, CBaseEntity* pOwner );
void FlyThink(void);
void HitThink(void);
void TipTouch(CBaseEntity* pOther);
void PreRemoval(void);
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: private:
static CGrappleTonguetip* CreateTip(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity); int m_GrappleType;
friend class CGrapple; bool m_bIsStuck;
bool m_bMissed;
#ifndef CLIENT_DLL
EHANDLE m_hGrappleTarget;
#endif
Vector m_vecOriginOffset;
}; };
#endif // GRAPPLE_TONGUETIP_H #endif // GRAPPLE_TONGUETIP_H

2
dlls/gearbox/pitdrone.cpp

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

4
dlls/gearbox/voltigore.cpp

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

4
dlls/headcrab.h

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

4
dlls/hgrunt.h

@ -60,9 +60,11 @@ public:
virtual BOOL FOkToSpeak(void); virtual BOOL FOkToSpeak(void);
void JustSpoke(void); void JustSpoke(void);
CUSTOM_SCHEDULES; CUSTOM_SCHEDULES
static TYPEDESCRIPTION m_SaveData[]; 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, // checking the feasibility of a grenade toss is kind of costly, so we do it every couple of seconds,
// not every server frame. // not every server frame.
float m_flNextGrenadeCheck; float m_flNextGrenadeCheck;

2
dlls/houndeye.cpp

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

2
dlls/ichthyosaur.cpp

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

2
dlls/islave.cpp

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

2
dlls/leech.cpp

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

2
dlls/squeakgrenade.cpp

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

1
dlls/talkmonster.h

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

2
dlls/tentacle.cpp

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

16
dlls/weapons.cpp

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

97
dlls/weapons.h

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

2
dlls/zombie.h

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

Loading…
Cancel
Save