2022-12-17 13:32:43 +01:00
/***
2013-08-30 13:34:05 -07:00
*
* Copyright ( c ) 1996 - 2001 , Valve LLC . All rights reserved .
*
* This product contains software technology licensed from Id
* Software , Inc . ( " Id Technology " ) . Id Technology ( c ) 1996 Id Software , Inc .
* All Rights Reserved .
*
* This source code contains proprietary and confidential information of
* Valve LLC and its suppliers . Access to this code is restricted to
* persons who have executed a written SDK license with Valve . Any access ,
* use or distribution of this code by or to any unlicensed person is illegal .
*
* * * */
// Base class for flying monsters. This overrides the movement test & execution code from CBaseMonster
2021-11-18 19:17:53 +01:00
# pragma once
2013-08-30 13:34:05 -07:00
class CFlyingMonster : public CBaseMonster
{
public :
2021-11-28 16:54:48 +01:00
int CheckLocalMove ( const Vector & vecStart , const Vector & vecEnd , CBaseEntity * pTarget , float * pflDist ) override ; // check validity of a straight move through space
bool FTriangulate ( const Vector & vecStart , const Vector & vecEnd , float flDist , CBaseEntity * pTargetEnt , Vector * pApex ) override ;
Activity GetStoppedActivity ( ) override ;
void Killed ( entvars_t * pevAttacker , int iGib ) override ;
void Stop ( ) override ;
2024-08-28 16:36:24 +02:00
float ChangeYaw ( int yawSpeed ) override ;
2021-11-28 16:54:48 +01:00
void HandleAnimEvent ( MonsterEvent_t * pEvent ) override ;
void MoveExecute ( CBaseEntity * pTargetEnt , const Vector & vecDir , float flInterval ) override ;
void Move ( float flInterval = 0.1 ) override ;
bool ShouldAdvanceRoute ( float flWaypointDist ) override ;
inline void SetFlyingMomentum ( float momentum ) { m_momentum = momentum ; }
inline void SetFlyingFlapSound ( const char * pFlapSound ) { m_pFlapSound = pFlapSound ; }
inline void SetFlyingSpeed ( float speed ) { m_flightSpeed = speed ; }
float CeilingZ ( const Vector & position ) ;
float FloorZ ( const Vector & position ) ;
bool ProbeZ ( const Vector & position , const Vector & probe , float * pFraction ) ;
2013-08-30 13:34:05 -07:00
// UNDONE: Save/restore this stuff!!!
protected :
2021-11-28 16:54:48 +01:00
Vector m_vecTravel ; // Current direction
float m_flightSpeed ; // Current flight speed (decays when not flapping or gliding)
float m_stopTime ; // Last time we stopped (to avoid switching states too soon)
float m_momentum ; // Weight for desired vs. momentum velocity
const char * m_pFlapSound ;
2021-01-13 22:52:16 +01:00
float m_flLastZYawTime ;
2013-08-30 13:34:05 -07:00
} ;