This commit is contained in:
FluorescentCIAAfricanAmerican
2020-04-22 12:56:21 -04:00
commit 3bf9df6b27
15370 changed files with 5489726 additions and 0 deletions
+273
View File
@@ -0,0 +1,273 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
// c_eyeball_boss.cpp
#include "cbase.h"
#include "NextBot/C_NextBot.h"
#include "c_eyeball_boss.h"
#include "tf_shareddefs.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#undef NextBot
#ifdef STAGING_ONLY
static ConVar cl_eyeball_boss_debug( "cl_eyeball_boss_debug", "0" );
#endif
//-----------------------------------------------------------------------------
IMPLEMENT_CLIENTCLASS_DT( C_EyeballBoss, DT_EyeballBoss, CEyeballBoss )
RecvPropVector( RECVINFO( m_lookAtSpot ) ),
RecvPropInt( RECVINFO( m_attitude ) ),
END_RECV_TABLE()
//-----------------------------------------------------------------------------
C_EyeballBoss::C_EyeballBoss()
{
m_ghostEffect = NULL;
m_auraEffect = NULL;
m_attitude = EYEBALL_CALM;
m_priorAttitude = m_attitude;
}
//-----------------------------------------------------------------------------
C_EyeballBoss::~C_EyeballBoss()
{
if ( m_ghostEffect )
{
ParticleProp()->StopEmission( m_ghostEffect );
m_ghostEffect = NULL;
}
if ( m_auraEffect )
{
ParticleProp()->StopEmission( m_auraEffect );
m_auraEffect = NULL;
}
}
//-----------------------------------------------------------------------------
void C_EyeballBoss::Spawn( void )
{
BaseClass::Spawn();
m_leftRightPoseParameter = -1;
m_upDownPoseParameter = -1;
m_myAngles = vec3_angle;
m_attitude = EYEBALL_CALM;
m_priorAttitude = m_attitude;
SetNextClientThink( CLIENT_THINK_ALWAYS );
}
//-----------------------------------------------------------------------------
void C_EyeballBoss::OnPreDataChanged( DataUpdateType_t updateType )
{
BaseClass::OnPreDataChanged( updateType );
m_priorAttitude = m_attitude;
}
//-----------------------------------------------------------------------------
void C_EyeballBoss::OnDataChanged( DataUpdateType_t updateType )
{
BaseClass::OnDataChanged( updateType );
if ( updateType == DATA_UPDATE_CREATED )
{
const char *pszMaterial = NULL;
const char *pszAuraEffect = "eyeboss_aura_calm";
switch ( GetTeamNumber() )
{
case TF_TEAM_RED:
{
pszAuraEffect = "eyeboss_team_red";
//pszMaterial = "models/effects/invulnfx_red.vmt";
}
break;
case TF_TEAM_BLUE:
{
pszAuraEffect = "eyeboss_team_blue";
//pszMaterial = "models/effects/invulnfx_blue.vmt";
}
break;
default:
{
if ( !m_ghostEffect )
{
m_ghostEffect = ParticleProp()->Create( "ghost_pumpkin", PATTACH_ABSORIGIN_FOLLOW );
}
}
break;
}
if ( !m_auraEffect )
{
m_auraEffect = ParticleProp()->Create( pszAuraEffect, PATTACH_ABSORIGIN_FOLLOW );
}
if ( pszMaterial )
{
m_InvulnerableMaterial.Init( pszMaterial, TEXTURE_GROUP_CLIENT_EFFECTS );
}
else
{
m_InvulnerableMaterial.Shutdown();
}
}
else if ( GetTeamNumber() == TF_TEAM_HALLOWEEN )
{
// update eyeball aura
if ( m_attitude != m_priorAttitude )
{
// kill the old aura
if ( m_auraEffect )
{
ParticleProp()->StopEmission( m_auraEffect );
}
switch( m_attitude )
{
case EYEBALL_CALM:
m_auraEffect = ParticleProp()->Create( "eyeboss_aura_calm", PATTACH_ABSORIGIN_FOLLOW );
break;
case EYEBALL_GRUMPY:
m_auraEffect = ParticleProp()->Create( "eyeboss_aura_grumpy", PATTACH_ABSORIGIN_FOLLOW );
break;
case EYEBALL_ANGRY:
m_auraEffect = ParticleProp()->Create( "eyeboss_aura_angry", PATTACH_ABSORIGIN_FOLLOW );
break;
}
m_priorAttitude = m_attitude;
}
}
}
//-----------------------------------------------------------------------------
void C_EyeballBoss::ClientThink( void )
{
// update eyeball aim
if ( m_leftRightPoseParameter < 0 )
{
m_leftRightPoseParameter = LookupPoseParameter( "left_right" );
}
if ( m_upDownPoseParameter < 0 )
{
m_upDownPoseParameter = LookupPoseParameter( "up_down" );
}
Vector myForward, myRight, myUp;
AngleVectors( m_myAngles, &myForward, &myRight, &myUp );
#ifdef STAGING_ONLY
if ( cl_eyeball_boss_debug.GetBool() )
{
QAngle myAbsAngles = GetAbsAngles();
DevMsg( "%3.2f: EYEBALL BEFORE AIM m_myAngles( %f, %f, %f ), myForward( %f, %f, %f ), GetAbsAngles( %f, %f, %f )\n",
gpGlobals->curtime, m_myAngles.x, m_myAngles.y, m_myAngles.z, myForward.x, myForward.y, myForward.z,
myAbsAngles.x, myAbsAngles.y, myAbsAngles.z );
}
#endif
const float myApproachRate = 3.0f; // 1.0f;
Vector toTarget = m_lookAtSpot - WorldSpaceCenter();
toTarget.NormalizeInPlace();
myForward += toTarget * myApproachRate * gpGlobals->frametime;
myForward.NormalizeInPlace();
QAngle myNewAngles;
VectorAngles( myForward, myNewAngles );
SetAbsAngles( myNewAngles );
m_myAngles = myNewAngles;
#ifdef STAGING_ONLY
if ( cl_eyeball_boss_debug.GetBool() )
{
QAngle myAbsAngles = GetAbsAngles();
DevMsg( "%3.2f: EYEBALL AFTER AIM m_myAngles( %f, %f, %f ), myForward( %f, %f, %f ), GetAbsAngles( %f, %f, %f )\n",
gpGlobals->curtime, m_myAngles.x, m_myAngles.y, m_myAngles.z, myForward.x, myForward.y, myForward.z,
myAbsAngles.x, myAbsAngles.y, myAbsAngles.z );
}
#endif
// set pose parameters to aim pupil directly at target
float toTargetRight = DotProduct( myRight, toTarget );
float toTargetUp = DotProduct( myUp, toTarget );
if ( m_leftRightPoseParameter >= 0 )
{
int angle = -50 * toTargetRight;
SetPoseParameter( m_leftRightPoseParameter, angle );
}
if ( m_upDownPoseParameter >= 0 )
{
int angle = -50 * toTargetUp;
SetPoseParameter( m_upDownPoseParameter, angle );
}
}
//-----------------------------------------------------------------------------
void C_EyeballBoss::SetDormant( bool bDormant )
{
BaseClass::SetDormant( bDormant );
}
//-----------------------------------------------------------------------------
void C_EyeballBoss::FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options )
{
}
//-----------------------------------------------------------------------------
QAngle const &C_EyeballBoss::GetRenderAngles( void )
{
return m_myAngles;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
int C_EyeballBoss::InternalDrawModel( int flags )
{
bool bUseInvulnMaterial = ( GetTeamNumber() == TF_TEAM_RED ) || ( GetTeamNumber() == TF_TEAM_BLUE );
if ( bUseInvulnMaterial )
{
modelrender->ForcedMaterialOverride( m_InvulnerableMaterial );
}
int ret = BaseClass::InternalDrawModel( flags );
if ( bUseInvulnMaterial )
{
modelrender->ForcedMaterialOverride( NULL );
}
return ret;
}
+55
View File
@@ -0,0 +1,55 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
#ifndef C_EYEBALL_BOSS_H
#define C_EYEBALL_BOSS_H
#include "c_ai_basenpc.h"
#define EYEBALL_ANGRY 2
#define EYEBALL_GRUMPY 1
#define EYEBALL_CALM 0
//--------------------------------------------------------------------------------------------------------
/**
* The client-side implementation of the Halloween Eyeball Boss
*/
class C_EyeballBoss : public C_NextBotCombatCharacter
{
public:
DECLARE_CLASS( C_EyeballBoss, C_NextBotCombatCharacter );
DECLARE_CLIENTCLASS();
C_EyeballBoss();
virtual ~C_EyeballBoss();
virtual void Spawn( void );
virtual void OnPreDataChanged( DataUpdateType_t updateType );
virtual void OnDataChanged( DataUpdateType_t updateType );
virtual bool IsNextBot() { return true; }
virtual void FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
virtual void ClientThink();
virtual void SetDormant( bool bDormant );
virtual QAngle const &GetRenderAngles( void );
virtual int InternalDrawModel( int flags );
private:
C_EyeballBoss( const C_EyeballBoss & ); // not defined, not accessible
Vector m_lookAtSpot;
int m_attitude;
int m_priorAttitude;
QAngle m_myAngles;
int m_leftRightPoseParameter;
int m_upDownPoseParameter;
HPARTICLEFFECT m_ghostEffect;
HPARTICLEFFECT m_auraEffect;
CMaterialReference m_InvulnerableMaterial;
};
#endif // C_EYEBALL_BOSS_H
@@ -0,0 +1,101 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
// C_HeadlessHatman.cpp
#include "cbase.h"
#include "NextBot/C_NextBot.h"
#include "c_headless_hatman.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#undef NextBot
//-----------------------------------------------------------------------------
IMPLEMENT_CLIENTCLASS_DT( C_HeadlessHatman, DT_HeadlessHatman, CHeadlessHatman )
END_RECV_TABLE()
//-----------------------------------------------------------------------------
C_HeadlessHatman::C_HeadlessHatman()
{
m_ghostEffect = NULL;
m_leftEyeEffect = NULL;
m_rightEyeEffect = NULL;
}
//-----------------------------------------------------------------------------
C_HeadlessHatman::~C_HeadlessHatman()
{
if ( m_ghostEffect )
{
ParticleProp()->StopEmission( m_ghostEffect );
m_ghostEffect = NULL;
}
if ( m_leftEyeEffect )
{
ParticleProp()->StopEmission( m_leftEyeEffect );
m_leftEyeEffect = NULL;
}
if ( m_rightEyeEffect )
{
ParticleProp()->StopEmission( m_rightEyeEffect );
m_rightEyeEffect = NULL;
}
}
//-----------------------------------------------------------------------------
void C_HeadlessHatman::Spawn( void )
{
BaseClass::Spawn();
m_vecViewOffset = Vector( 0, 0, 100.0f );
if ( !m_ghostEffect )
{
m_ghostEffect = ParticleProp()->Create( "ghost_pumpkin", PATTACH_ABSORIGIN_FOLLOW );
}
SetNextClientThink( gpGlobals->curtime + 1.0f );
}
//-----------------------------------------------------------------------------
void C_HeadlessHatman::ClientThink( void )
{
if ( !m_leftEyeEffect )
{
m_leftEyeEffect = ParticleProp()->Create( "halloween_boss_eye_glow", PATTACH_POINT_FOLLOW, "lefteye" );
}
if ( !m_rightEyeEffect )
{
m_rightEyeEffect = ParticleProp()->Create( "halloween_boss_eye_glow", PATTACH_POINT_FOLLOW, "righteye" );
}
SetNextClientThink( CLIENT_THINK_NEVER );
}
//-----------------------------------------------------------------------------
// Return the origin for player observers tracking this target
Vector C_HeadlessHatman::GetObserverCamOrigin( void )
{
return EyePosition();
}
//-----------------------------------------------------------------------------
void C_HeadlessHatman::FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options )
{
if ( event == 7001 )
{
// footstep event
EmitSound( "Halloween.HeadlessBossFootfalls" );
ParticleProp()->Create( "halloween_boss_foot_impact", PATTACH_ABSORIGIN, 0 );
}
}
@@ -0,0 +1,39 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
#ifndef C_HEADLESS_HATMAN_H
#define C_HEADLESS_HATMAN_H
#include "c_ai_basenpc.h"
//--------------------------------------------------------------------------------------------------------
/**
* The client-side implementation of the Dark Knight
*/
class C_HeadlessHatman : public C_NextBotCombatCharacter
{
public:
DECLARE_CLASS( C_HeadlessHatman, C_NextBotCombatCharacter );
DECLARE_CLIENTCLASS();
C_HeadlessHatman();
virtual ~C_HeadlessHatman();
public:
virtual void Spawn( void );
virtual bool IsNextBot() { return true; }
virtual Vector GetObserverCamOrigin( void ); // Return the origin for player observers tracking this target
virtual void FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
virtual void ClientThink();
private:
C_HeadlessHatman( const C_HeadlessHatman & ); // not defined, not accessible
HPARTICLEFFECT m_ghostEffect;
HPARTICLEFFECT m_leftEyeEffect;
HPARTICLEFFECT m_rightEyeEffect;
};
#endif // C_HEADLESS_HATMAN_H
+148
View File
@@ -0,0 +1,148 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
//
//=============================================================================
#include "cbase.h"
#include "NextBot/C_NextBot.h"
#include "c_merasmus.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#undef NextBot
//-----------------------------------------------------------------------------
IMPLEMENT_CLIENTCLASS_DT( C_Merasmus, DT_Merasmus, CMerasmus )
RecvPropBool( RECVINFO( m_bRevealed ) ),
RecvPropBool( RECVINFO( m_bIsDoingAOEAttack ) ),
RecvPropBool( RECVINFO( m_bStunned ) ),
END_RECV_TABLE()
//-----------------------------------------------------------------------------
C_Merasmus::C_Merasmus()
{
m_ghostEffect = NULL;
m_aoeEffect = NULL;
m_stunEffect = NULL;
m_bRevealed = false;
m_bWasRevealed = false;
m_bIsDoingAOEAttack = false;
m_bStunned = false;
}
//-----------------------------------------------------------------------------
C_Merasmus::~C_Merasmus()
{
if ( m_ghostEffect )
{
ParticleProp()->StopEmission( m_ghostEffect );
m_ghostEffect = NULL;
}
if ( m_aoeEffect )
{
ParticleProp()->StopEmission( m_aoeEffect );
m_aoeEffect = NULL;
}
if ( m_stunEffect )
{
ParticleProp()->StopEmission( m_stunEffect );
m_stunEffect = NULL;
}
}
//-----------------------------------------------------------------------------
void C_Merasmus::Spawn( void )
{
BaseClass::Spawn();
m_vecViewOffset = Vector( 0, 0, 100.0f );
}
//-----------------------------------------------------------------------------
// Return the origin for player observers tracking this target
Vector C_Merasmus::GetObserverCamOrigin( void )
{
return EyePosition();
}
//-----------------------------------------------------------------------------
void C_Merasmus::OnPreDataChanged( DataUpdateType_t updateType )
{
BaseClass::OnPreDataChanged( updateType );
m_bWasRevealed = m_bRevealed;
}
//-----------------------------------------------------------------------------
void C_Merasmus::OnDataChanged( DataUpdateType_t updateType )
{
BaseClass::OnDataChanged( updateType );
if ( m_bRevealed != m_bWasRevealed )
{
if ( m_bRevealed )
{
if ( !m_ghostEffect )
{
m_ghostEffect = ParticleProp()->Create( "merasmus_ambient_body", PATTACH_ABSORIGIN_FOLLOW );
}
}
else
{
if ( m_ghostEffect )
{
ParticleProp()->StopEmission( m_ghostEffect );
m_ghostEffect = NULL;
}
}
}
// book attack
if ( m_bIsDoingAOEAttack )
{
if ( !m_aoeEffect )
{
m_aoeEffect = ParticleProp()->Create( "merasmus_book_attack", PATTACH_POINT_FOLLOW, LookupAttachment( "effect_hand_R" ), Vector( 16.f, 0.f, 0.f ) );
}
}
else
{
if ( m_aoeEffect )
{
ParticleProp()->StopEmission( m_aoeEffect );
m_aoeEffect = NULL;
}
}
// stunned
if ( m_bStunned )
{
if ( !m_stunEffect )
{
m_stunEffect = ParticleProp()->Create( "merasmus_dazed", PATTACH_POINT_FOLLOW, LookupAttachment( "head" ) );
}
}
else
{
if ( m_stunEffect )
{
ParticleProp()->StopEmission( m_stunEffect );
m_stunEffect = NULL;
}
}
}
int C_Merasmus::GetSkin()
{
return ( m_bIsDoingAOEAttack || m_bStunned ) ? 0 : 1;
}
+49
View File
@@ -0,0 +1,49 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
//
//=============================================================================
#ifndef C_MERASMUS_H
#define C_MERASMUS_H
#include "c_ai_basenpc.h"
//--------------------------------------------------------------------------------------------------------
/**
* The client-side implementation of the Dark Knight
*/
class C_Merasmus : public C_NextBotCombatCharacter
{
public:
DECLARE_CLASS( C_Merasmus, C_NextBotCombatCharacter );
DECLARE_CLIENTCLASS();
C_Merasmus();
virtual ~C_Merasmus();
public:
virtual void Spawn( void );
virtual bool IsNextBot() { return true; }
virtual Vector GetObserverCamOrigin( void ); // Return the origin for player observers tracking this target
virtual void OnPreDataChanged( DataUpdateType_t updateType );
virtual void OnDataChanged( DataUpdateType_t updateType );
virtual int GetSkin();
private:
C_Merasmus( const C_Merasmus & ); // not defined, not accessible
HPARTICLEFFECT m_ghostEffect;
HPARTICLEFFECT m_aoeEffect;
HPARTICLEFFECT m_stunEffect;
bool m_bWasRevealed;
CNetworkVar( bool, m_bRevealed );
CNetworkVar( bool, m_bIsDoingAOEAttack );
CNetworkVar( bool, m_bStunned );
};
#endif // C_MERASMUS_H
@@ -0,0 +1,29 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
//
//=============================================================================
#include "cbase.h"
#include "c_merasmus_dancer.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
IMPLEMENT_CLIENTCLASS_DT( C_MerasmusDancer, DT_MerasmusDancer, CMerasmusDancer )
END_RECV_TABLE()
//-----------------------------------------------------------------------------
C_MerasmusDancer::C_MerasmusDancer()
{
}
//-----------------------------------------------------------------------------
C_MerasmusDancer::~C_MerasmusDancer()
{
}
@@ -0,0 +1,26 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
//
//=============================================================================
#ifndef C_MERASMUS_DANCER_H
#define C_MERASMUS_DANCER_H
#include "c_baseanimating.h"
//--------------------------------------------------------------------------------------------------------
class C_MerasmusDancer : public C_BaseAnimating
{
public:
DECLARE_CLASS( C_MerasmusDancer, C_BaseAnimating );
DECLARE_CLIENTCLASS();
C_MerasmusDancer();
virtual ~C_MerasmusDancer();
private:
C_MerasmusDancer( const C_MerasmusDancer & ); // not defined, not accessible
};
#endif // C_MERASMUS_DANCER_H
+38
View File
@@ -0,0 +1,38 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
// c_eyeball_boss.cpp
#include "cbase.h"
#include "NextBot/C_NextBot.h"
#include "c_zombie.h"
#include "tf_shareddefs.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
//-----------------------------------------------------------------------------
IMPLEMENT_CLIENTCLASS_DT( C_Zombie, DT_Zombie, CZombie )
RecvPropFloat( RECVINFO( m_flHeadScale ) ),
END_RECV_TABLE()
C_Zombie::C_Zombie()
{
}
bool C_Zombie::ShouldCollide( int collisionGroup, int contentsMask ) const
{
if ( collisionGroup == COLLISION_GROUP_PLAYER_MOVEMENT )
return false;
return BaseClass::ShouldCollide( collisionGroup, contentsMask );
}
extern void BuildBigHeadTransformations( CBaseAnimating *pObject, CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed, float flScale );
void C_Zombie::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed )
{
BaseClass::BuildTransformations( hdr, pos, q, cameraTransform, boneMask, boneComputed );
m_BoneAccessor.SetWritableBones( BONE_USED_BY_ANYTHING );
BuildBigHeadTransformations( this, hdr, pos, q, cameraTransform, boneMask, boneComputed, m_flHeadScale );
}
+32
View File
@@ -0,0 +1,32 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
#ifndef C_ZOMBIE_H
#define C_ZOMBIE_H
#include "c_ai_basenpc.h"
#include "props_shared.h"
//--------------------------------------------------------------------------------------------------------
/**
* The client-side implementation of the Halloween Zombie
*/
class C_Zombie : public C_NextBotCombatCharacter
{
public:
DECLARE_CLASS( C_Zombie, C_NextBotCombatCharacter );
DECLARE_CLIENTCLASS();
C_Zombie();
virtual bool IsNextBot() { return true; }
virtual bool ShouldCollide( int collisionGroup, int contentsMask ) const;
virtual void BuildTransformations( CStudioHdr *hdr, Vector *pos, Quaternion q[], const matrix3x4_t& cameraTransform, int boneMask, CBoneBitList &boneComputed ) OVERRIDE;
private:
C_Zombie( const C_Zombie & ); // not defined, not accessible
float m_flHeadScale;
};
#endif // C_EYEBALL_BOSS_H