upload "kind" alien swarm

This commit is contained in:
nillerusr
2023-10-03 17:23:56 +03:00
parent b7bd94c52e
commit 7d3c0d8b5a
4229 changed files with 462903 additions and 495158 deletions

View File

@@ -1,4 +1,4 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Spawn, think, and use functions for common brush entities.
//
@@ -12,7 +12,7 @@
#include "engine/IEngineSound.h"
#include "globals.h"
#include "filters.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -498,10 +498,8 @@ END_DATADESC()
extern void SendProxy_Origin( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID );
void SendProxy_FuncRotatingOrigin( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID )
{
#ifdef TF_DLL
CFuncRotating *entity = (CFuncRotating*)pStruct;
Assert( entity );
if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
{
const Vector *v = &entity->m_vecClientOrigin;
@@ -510,29 +508,10 @@ void SendProxy_FuncRotatingOrigin( const SendProp *pProp, const void *pStruct, c
pOut->m_Vector[ 2 ] = v->z;
return;
}
#endif
SendProxy_Origin( pProp, pStruct, pData, pOut, iElement, objectID );
}
/*
extern void SendProxy_Angles( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID );
void SendProxy_FuncRotatingAngles( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID )
{
CFuncRotating *entity = (CFuncRotating*)pStruct;
Assert( entity );
if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
{
const QAngle *a = &entity->m_vecClientAngles;
pOut->m_Vector[ 0 ] = anglemod( a->x );
pOut->m_Vector[ 1 ] = anglemod( a->y );
pOut->m_Vector[ 2 ] = anglemod( a->z );
return;
}
SendProxy_Angles( pProp, pStruct, pData, pOut, iElement, objectID );
}
*/
void SendProxy_FuncRotatingAngle( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID)
{
CFuncRotating *entity = (CFuncRotating*)pStruct;
@@ -540,12 +519,11 @@ void SendProxy_FuncRotatingAngle( const SendProp *pProp, const void *pStruct, co
vec_t const *qa = (vec_t *)pData;
vec_t const *ea = entity->GetLocalAngles().Base();
NOTE_UNUSED(ea);
// Assert its actually an index into m_angRotation if not this won't work
Assert( (uintp)qa >= (uintp)ea && (uintp)qa < (uintp)ea + sizeof( QAngle ));
#ifdef TF_DLL
if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
{
const QAngle *a = &entity->m_vecClientAngles;
@@ -553,7 +531,6 @@ void SendProxy_FuncRotatingAngle( const SendProp *pProp, const void *pStruct, co
pOut->m_Float = anglemod( (*a)[ qa - ea ] );
return;
}
#endif
pOut->m_Float = anglemod( *qa );
@@ -564,16 +541,13 @@ void SendProxy_FuncRotatingAngle( const SendProp *pProp, const void *pStruct, co
extern void SendProxy_SimulationTime( const SendProp *pProp, const void *pStruct, const void *pVarData, DVariant *pOut, int iElement, int objectID );
void SendProxy_FuncRotatingSimulationTime( const SendProp *pProp, const void *pStruct, const void *pVarData, DVariant *pOut, int iElement, int objectID )
{
#ifdef TF_DLL
CFuncRotating *entity = (CFuncRotating*)pStruct;
Assert( entity );
if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
{
pOut->m_Int = 0;
return;
}
#endif
SendProxy_SimulationTime( pProp, pStruct, pVarData, pOut, iElement, objectID );
}
@@ -605,7 +579,7 @@ bool CFuncRotating::KeyValue( const char *szKeyName, const char *szValue )
else if (FStrEq(szKeyName, "Volume"))
{
m_flVolume = atof(szValue) / 10.0;
m_flVolume = clamp(m_flVolume, 0.0f, 1.0f);
m_flVolume = clamp(m_flVolume, 0.0, 1.0f);
}
else
{
@@ -621,9 +595,7 @@ bool CFuncRotating::KeyValue( const char *szKeyName, const char *szValue )
//-----------------------------------------------------------------------------
void CFuncRotating::Spawn( )
{
#ifdef TF_DLL
AddSpawnFlags( SF_BRUSH_ROTATE_CLIENTSIDE );
#endif
//
// Maintain compatibility with previous maps.
@@ -748,13 +720,11 @@ void CFuncRotating::Spawn( )
SetSolid( SOLID_BSP );
}
#ifdef TF_DLL
if ( HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) )
{
m_vecClientOrigin = GetLocalOrigin();
m_vecClientAngles = GetLocalAngles();
}
#endif
}
//-----------------------------------------------------------------------------
@@ -811,17 +781,12 @@ void CFuncRotating::HurtTouch ( CBaseEntity *pOther )
// calculate damage based on rotation speed
m_flBlockDamage = GetLocalAngularVelocity().Length() / 10;
#ifdef HL1_DLL
if( m_flBlockDamage > 0 )
#endif
{
pOther->TakeDamage( CTakeDamageInfo( this, this, m_flBlockDamage, DMG_CRUSH ) );
Vector vecNewVelocity = pOther->GetAbsOrigin() - WorldSpaceCenter();
VectorNormalize(vecNewVelocity);
vecNewVelocity *= m_flBlockDamage;
pOther->SetAbsVelocity( vecNewVelocity );
}
pOther->TakeDamage( CTakeDamageInfo( this, this, m_flBlockDamage, DMG_CRUSH ) );
Vector vecNewVelocity = pOther->GetAbsOrigin() - WorldSpaceCenter();
VectorNormalize(vecNewVelocity);
vecNewVelocity *= m_flBlockDamage;
pOther->SetAbsVelocity( vecNewVelocity );
}
@@ -839,11 +804,11 @@ void CFuncRotating::RampPitchVol( void )
// Calc volume and pitch as % of maximum vol and pitch.
//
float fpct = fabs(m_flSpeed) / m_flMaxSpeed;
float fvol = clamp(m_flVolume * fpct, 0.f, 1.f); // slowdown volume ramps down to 0
float fvol = clamp(m_flVolume * fpct, 0, 1); // slowdown volume ramps down to 0
float fpitch = FANPITCHMIN + (FANPITCHMAX - FANPITCHMIN) * fpct;
int pitch = clamp(FastFloatToSmallInt(fpitch), 0, 255);
int pitch = clamp(fpitch, 0, 255);
if (pitch == PITCH_NORM)
{
pitch = PITCH_NORM - 1;
@@ -1260,7 +1225,7 @@ void CFuncRotating::InputSetSpeed( inputdata_t &inputdata )
float flSpeed = inputdata.value.Float();
m_bReversed = flSpeed < 0 ? true : false;
flSpeed = fabs(flSpeed);
SetTargetSpeed( clamp( flSpeed, 0.f, 1.f ) * m_flMaxSpeed );
SetTargetSpeed( clamp( flSpeed, 0, 1 ) * m_flMaxSpeed );
}
@@ -1337,10 +1302,7 @@ void CFuncRotating::InputToggle( inputdata_t &inputdata )
//-----------------------------------------------------------------------------
void CFuncRotating::Blocked( CBaseEntity *pOther )
{
#ifdef HL1_DLL
if( m_flBlockDamage > 0 )
#endif
pOther->TakeDamage( CTakeDamageInfo( this, this, m_flBlockDamage, DMG_CRUSH ) );
pOther->TakeDamage( CTakeDamageInfo( this, this, m_flBlockDamage, DMG_CRUSH ) );
}
@@ -1440,6 +1402,9 @@ bool CFuncVPhysicsClip::EntityPassesFilter( CBaseEntity *pOther )
if ( pFilter )
return pFilter->PassesFilter( this, pOther );
if ( !pOther->VPhysicsGetObject() )
return false;
if ( pOther->GetMoveType() == MOVETYPE_VPHYSICS && pOther->VPhysicsGetObject()->IsMoveable() )
return true;