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 462900 additions and 495155 deletions
+32 -8
View File
@@ -1,4 +1,4 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Simple, small, free-standing tools for building AIs
//
@@ -53,13 +53,19 @@ public:
m_flMarkTolerance( NO_MARK )
{
}
void SetMark( const Vector &v, float tolerance )
{
m_vMark = v;
m_flMarkTolerance = tolerance;
}
void SetMark( CBaseEntity *pEntity, float tolerance )
{
if ( pEntity )
{
m_vMark = pEntity->GetAbsOrigin();
m_flMarkTolerance = tolerance;
m_flMarkTolerance = tolerance ;
}
}
@@ -73,28 +79,46 @@ public:
return ( m_flMarkTolerance != NO_MARK );
}
bool TargetMoved( CBaseEntity *pEntity )
bool TargetMoved( const Vector &v )
{
if ( IsMarkSet() && pEntity != NULL )
if ( IsMarkSet() )
{
float distance = ( m_vMark - pEntity->GetAbsOrigin() ).Length();
float distance = ( m_vMark - v ).Length();
if ( distance > m_flMarkTolerance )
return true;
}
return false;
}
bool TargetMoved2D( CBaseEntity *pEntity )
bool TargetMoved2D( const Vector2D &v )
{
if ( IsMarkSet() && pEntity != NULL )
if ( IsMarkSet() )
{
float distance = ( m_vMark.AsVector2D() - pEntity->GetAbsOrigin().AsVector2D() ).Length();
float distance = ( m_vMark.AsVector2D() - v ).Length();
if ( distance > m_flMarkTolerance )
return true;
}
return false;
}
bool TargetMoved( CBaseEntity *pEntity )
{
if ( pEntity == NULL )
{
return false;
}
return TargetMoved( pEntity->GetAbsOrigin() );
}
bool TargetMoved2D( CBaseEntity *pEntity )
{
if ( pEntity == NULL )
{
return false;
}
return TargetMoved2D( pEntity->GetAbsOrigin().AsVector2D() );
}
Vector GetMarkPos() { return m_vMark; }
private: