mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-05 03:24:39 +00:00
Update grapple
This commit is contained in:
parent
b1c7892f23
commit
676267f45d
@ -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 )
|
||||
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
|
||||
case WEAPON_DISPLACER:
|
||||
pWeapon = &g_Displacer;
|
||||
break;
|
||||
case WEAPON_GRAPPLE:
|
||||
pWeapon = &g_Grapple;
|
||||
break;
|
||||
case WEAPON_EAGLE:
|
||||
pWeapon = &g_Eagle;
|
||||
break;
|
||||
|
@ -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[];
|
||||
|
@ -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;
|
||||
|
@ -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[];
|
||||
|
@ -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.
|
||||
@ -83,4 +85,4 @@ public:
|
||||
};
|
||||
|
||||
|
||||
#endif // BULLSQUID_H
|
||||
#endif // BULLSQUID_H
|
||||
|
11
dlls/cbase.h
11
dlls/cbase.h
@ -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:
|
||||
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;
|
||||
|
@ -244,6 +244,8 @@ public:
|
||||
|
||||
CUSTOM_SCHEDULES
|
||||
|
||||
virtual int SizeForGrapple() { return GRAPPLE_LARGE; }
|
||||
|
||||
private:
|
||||
static const char *pAttackHitSounds[];
|
||||
static const char *pBeamAttackSounds[];
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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),
|
||||
};
|
||||
PRECACHE_MODEL( "models/shock_effect.mdl" );
|
||||
}
|
||||
|
||||
IMPLEMENT_SAVERESTORE(CGrappleTonguetip, CBaseEntity);
|
||||
|
||||
//=========================================================
|
||||
// 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 );
|
||||
|
||||
SetThink( &CBarnacleGrappleTip::FlyThink );
|
||||
SetTouch( &CBarnacleGrappleTip::TongueTouch );
|
||||
|
||||
Vector vecAngles = pev->angles;
|
||||
|
||||
vecAngles.x -= 30.0;
|
||||
|
||||
pev->angles = vecAngles;
|
||||
|
||||
UTIL_MakeVectors( pev->angles );
|
||||
|
||||
vecAngles.x = -( 30.0 + vecAngles.x );
|
||||
|
||||
pev->velocity = g_vecZero;
|
||||
|
||||
pev->gravity = 1.0;
|
||||
|
||||
pev->nextthink = gpGlobals->time + 0.02;
|
||||
|
||||
m_bIsStuck = FALSE;
|
||||
m_bMissed = FALSE;
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// Purpose: CreateTip
|
||||
//=========================================================
|
||||
CGrappleTonguetip* CGrappleTonguetip::CreateTip(entvars_t *pevOwner, Vector vecStart, Vector vecVelocity)
|
||||
void CBarnacleGrappleTip::FlyThink()
|
||||
{
|
||||
CGrappleTonguetip* pTonguetip = GetClassPtr((CGrappleTonguetip *)NULL);
|
||||
pTonguetip->Spawn();
|
||||
UTIL_MakeAimVectors( pev->angles );
|
||||
|
||||
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;
|
||||
pev->angles = UTIL_VecToAngles( gpGlobals->v_forward );
|
||||
|
||||
return pTonguetip;
|
||||
}
|
||||
const float flNewVel = ( ( pev->velocity.Length() * 0.8 ) + 400.0 );
|
||||
|
||||
//=========================================================
|
||||
// Purpose: FlyThink
|
||||
//=========================================================
|
||||
void CGrappleTonguetip::FlyThink(void)
|
||||
{
|
||||
ALERT(at_console, "FlyThink\n");
|
||||
pev->velocity = pev->velocity * 0.2 + ( flNewVel * gpGlobals->v_forward );
|
||||
|
||||
pev->nextthink = gpGlobals->time + 0.1f;
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// Purpose: HitThink
|
||||
//=========================================================
|
||||
void CGrappleTonguetip::HitThink(void)
|
||||
{
|
||||
ALERT(at_console, "HitThink\n");
|
||||
|
||||
pev->nextthink = gpGlobals->time + 0.1f;
|
||||
}
|
||||
|
||||
//=========================================================
|
||||
// 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");
|
||||
|
||||
TraceResult tr;
|
||||
UTIL_TraceLine(pev->origin, pev->origin + pev->velocity * 10, dont_ignore_monsters, ENT(pev), &tr);
|
||||
|
||||
pev->velocity = Vector(0, 0, 0);
|
||||
|
||||
int content = UTIL_PointContents(tr.vecEndPos);
|
||||
int hitFlags = pOther->pev->flags;
|
||||
|
||||
m_pMyGrappler->m_fTipHit = TRUE;
|
||||
m_pMyGrappler->m_iHitFlags = hitFlags;
|
||||
|
||||
if (hitFlags & (FL_CLIENT | FL_MONSTER))
|
||||
if( !g_pGameRules->IsMultiplayer() )
|
||||
{
|
||||
// Set player attached flag.
|
||||
if (pOther->IsPlayer())
|
||||
((CBasePlayer*)pOther)->m_afPhysicsFlags |= PFLAG_ATTACHED;
|
||||
|
||||
pev->movetype = MOVETYPE_FOLLOW;
|
||||
pev->aiment = ENT(pOther->pev);
|
||||
|
||||
m_pMyGrappler->OnTongueTipHitEntity(pOther);
|
||||
//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
|
||||
{
|
||||
pev->velocity = Vector(0, 0, 0);
|
||||
pev->movetype = MOVETYPE_NONE;
|
||||
pev->gravity = 0.0f;
|
||||
|
||||
m_pMyGrappler->OnTongueTipHitSurface(tr.vecEndPos);
|
||||
}
|
||||
|
||||
EMIT_SOUND_DYN(ENT(pev), CHAN_VOICE, "weapons/bgrapple_impact.wav", 1, ATTN_NORM, 0, 100);
|
||||
|
||||
SetTouch( NULL );
|
||||
SetThink(&CGrappleTonguetip::HitThink);
|
||||
pev->nextthink = gpGlobals->time + 0.1f;
|
||||
}
|
||||
|
||||
void CGrappleTonguetip::PreRemoval(void)
|
||||
{
|
||||
if (pev->aiment != NULL)
|
||||
{
|
||||
CBaseEntity* pEnt = GetClassPtr((CBaseEntity*)VARS(pev->aiment));
|
||||
if (pEnt && pEnt->IsPlayer())
|
||||
//TODO: should probably clamp at sv_maxvelocity to prevent the tip from going off course. - Solokiller
|
||||
if( pev->velocity.Length() > 2000.0 )
|
||||
{
|
||||
// Remove attached flag of the target entity.
|
||||
((CBasePlayer*)pEnt)->m_afPhysicsFlags &= ~PFLAG_ATTACHED;
|
||||
pev->velocity = pev->velocity.Normalize() * 2000.0;
|
||||
}
|
||||
}
|
||||
|
||||
CBaseEntity::PreRemoval();
|
||||
}
|
||||
pev->nextthink = gpGlobals->time + 0.02;
|
||||
}
|
||||
|
||||
void CBarnacleGrappleTip::OffsetThink()
|
||||
{
|
||||
//Nothing
|
||||
}
|
||||
|
||||
void CBarnacleGrappleTip::TongueTouch( CBaseEntity* pOther )
|
||||
{
|
||||
if( !pOther )
|
||||
{
|
||||
targetClass = GRAPPLE_NOT_A_TARGET;
|
||||
m_bMissed = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pOther->IsPlayer() )
|
||||
{
|
||||
targetClass = GRAPPLE_MEDIUM;
|
||||
|
||||
m_hGrappleTarget = pOther;
|
||||
|
||||
m_bIsStuck = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetClass = CheckTarget( pOther );
|
||||
|
||||
if( targetClass != GRAPPLE_NOT_A_TARGET )
|
||||
{
|
||||
m_bIsStuck = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bMissed = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pev->velocity = g_vecZero;
|
||||
|
||||
m_GrappleType = targetClass;
|
||||
|
||||
SetThink( &CBarnacleGrappleTip::OffsetThink );
|
||||
pev->nextthink = gpGlobals->time + 0.02;
|
||||
|
||||
SetTouch( NULL );
|
||||
}
|
||||
|
||||
int CBarnacleGrappleTip::CheckTarget( CBaseEntity* pTarget )
|
||||
{
|
||||
if( !pTarget )
|
||||
return GRAPPLE_NOT_A_TARGET;
|
||||
|
||||
if( pTarget->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)
|
||||
{
|
||||
if (pTarget->SizeForGrapple() == GRAPPLE_FIXED) {
|
||||
bIsFixed = true;
|
||||
} else {
|
||||
m_hGrappleTarget = pTarget;
|
||||
m_vecOriginOffset = pev->origin - pTarget->pev->origin;
|
||||
return pTarget->SizeForGrapple();
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -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[];
|
||||
*/
|
||||
int targetClass;
|
||||
void Precache();
|
||||
void Spawn();
|
||||
|
||||
void FlyThink();
|
||||
void OffsetThink();
|
||||
|
||||
void TongueTouch( CBaseEntity* pOther );
|
||||
|
||||
int CheckTarget( CBaseEntity* pTarget );
|
||||
|
||||
void SetPosition( Vector vecOrigin, Vector vecAngles, CBaseEntity* pOwner );
|
||||
|
||||
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
|
||||
|
||||
void Spawn(void);
|
||||
void FlyThink(void);
|
||||
void HitThink(void);
|
||||
void TipTouch(CBaseEntity* pOther);
|
||||
void PreRemoval(void);
|
||||
|
||||
CGrapple* m_pMyGrappler;
|
||||
|
||||
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
|
||||
#endif // GRAPPLE_TONGUETIP_H
|
||||
|
@ -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;
|
||||
|
@ -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:
|
||||
void GibMonster();
|
||||
Schedule_t* GetSchedule();
|
||||
Schedule_t* GetScheduleOfType(int Type);
|
||||
|
||||
virtual int SizeForGrapple() { return GRAPPLE_SMALL; }
|
||||
};
|
||||
|
||||
LINK_ENTITY_TO_CLASS(monster_alien_babyvoltigore, CBabyVoltigore)
|
||||
|
@ -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[];
|
||||
@ -56,4 +58,4 @@ public:
|
||||
static const char *pBiteSounds[];
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -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;
|
||||
|
@ -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!
|
||||
|
@ -90,6 +90,8 @@ public:
|
||||
float FlPitchDiff( void );
|
||||
float ChangePitch( int speed );
|
||||
|
||||
virtual int SizeForGrapple() { return GRAPPLE_LARGE; }
|
||||
|
||||
Vector m_SaveVelocity;
|
||||
float m_idealDist;
|
||||
|
||||
|
@ -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 );
|
||||
|
@ -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?
|
||||
|
@ -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;
|
||||
|
@ -154,7 +154,8 @@ 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;
|
||||
|
||||
|
@ -74,6 +74,8 @@ public:
|
||||
|
||||
int Classify( void );
|
||||
|
||||
virtual int SizeForGrapple() { return GRAPPLE_FIXED; }
|
||||
|
||||
int Level( float dz );
|
||||
int MyLevel( void );
|
||||
float MyHeight( 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[] =
|
||||
|
||||
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[] =
|
||||
{
|
||||
|
117
dlls/weapons.h
117
dlls/weapons.h
@ -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
|
||||
|
||||
void Spawn(void);
|
||||
void Precache(void);
|
||||
int iItemSlot(void) { return 1; }
|
||||
int GetItemInfo(ItemInfo *p);
|
||||
|
||||
void PrimaryAttack(void);
|
||||
BOOL Deploy(void);
|
||||
void Holster(int skiplocal = 0);
|
||||
void WeaponIdle(void);
|
||||
void ItemPostFrame(void);
|
||||
|
||||
virtual BOOL ShouldWeaponIdle(void) { return TRUE; }
|
||||
|
||||
virtual BOOL UseDecrement(void)
|
||||
enum FireState
|
||||
{
|
||||
#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 );
|
||||
|
||||
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);
|
||||
|
||||
enum GRAPPLE_FIRESTATE
|
||||
{
|
||||
FIRESTATE_NONE = 0,
|
||||
FIRESTATE_FIRE,
|
||||
FIRESTATE_FIRE2,
|
||||
FIRESTATE_WAIT,
|
||||
FIRESTATE_REACH,
|
||||
FIRESTATE_TRAVEL,
|
||||
FIRESTATE_RELEASE,
|
||||
OFF = 0,
|
||||
CHARGE = 1
|
||||
};
|
||||
|
||||
int m_iFirestate;
|
||||
int m_iHitFlags;
|
||||
BOOL m_fTipHit;
|
||||
CGrappleTonguetip* m_pTongueTip;
|
||||
CBeam* m_pBeam;
|
||||
float m_flNextPullSoundTime;
|
||||
BOOL m_fPlayPullSound;
|
||||
void Precache( void );
|
||||
void Spawn( void );
|
||||
int iItemSlot(void) { return 1; }
|
||||
void EndAttack( void );
|
||||
|
||||
int GetItemInfo(ItemInfo *p);
|
||||
int AddToPlayer( CBasePlayer* pPlayer );
|
||||
BOOL Deploy();
|
||||
void Holster( int skiplocal /* = 0 */ );
|
||||
void WeaponIdle( void );
|
||||
void PrimaryAttack( void );
|
||||
|
||||
void Fire( Vector vecOrigin, Vector vecDir );
|
||||
|
||||
void CreateEffect( void );
|
||||
void UpdateEffect( void );
|
||||
void DestroyEffect( void );
|
||||
virtual BOOL UseDecrement(void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const char* MyWModel() { return "models/w_bgrap.mdl"; }
|
||||
|
||||
private:
|
||||
CBarnacleGrappleTip* m_pTip;
|
||||
|
||||
CBeam* m_pBeam;
|
||||
|
||||
float m_flShootTime;
|
||||
float m_flDamageTime;
|
||||
|
||||
bool m_bGrappling;
|
||||
bool m_bMissed;
|
||||
bool m_bMomentaryStuck;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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…
x
Reference in New Issue
Block a user