mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-09-01 06:59:20 +00:00
upload "kind" alien swarm
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -12,31 +12,21 @@
|
||||
|
||||
#include "cbase.h"
|
||||
#include "trigger_area_capture.h"
|
||||
#include "shareddefs.h"
|
||||
#include "envspark.h"
|
||||
#include "GameEventListener.h"
|
||||
|
||||
class CFuncTrackTrain;
|
||||
class CPathTrack;
|
||||
class CTeamControlPoint;
|
||||
|
||||
#define TEAM_TRAIN_ALERT_DISTANCE 750 // alert is the VO warning
|
||||
#define TEAM_TRAIN_ALARM_DISTANCE 200 // alarm is the looping sound played at the control point
|
||||
#define TF_TRAIN_ALERT_DISTANCE 750 // alert is the VO warning
|
||||
#define TF_TRAIN_ALARM_DISTANCE 200 // alarm is the looping sound played at the control point
|
||||
|
||||
#define TEAM_TRAIN_ALERT "Announcer.Cart.Warning"
|
||||
#define TEAM_TRAIN_FINAL_ALERT "Announcer.Cart.FinalWarning"
|
||||
#define TEAM_TRAIN_ALARM "Cart.Warning"
|
||||
#define TEAM_TRAIN_ALARM_SINGLE "Cart.WarningSingle"
|
||||
#define TF_TRAIN_ATTACK_ALERT "Announcer.Cart.AttackWarning"
|
||||
#define TF_TRAIN_DEFEND_ALERT "Announcer.Cart.DefendWarning"
|
||||
#define TF_TRAIN_ATTACK_FINAL_ALERT "Announcer.Cart.AttackFinalWarning"
|
||||
#define TF_TRAIN_DEFEND_FINAL_ALERT "Announcer.Cart.DefendFinalWarning"
|
||||
#define TF_TRAIN_ALARM "Cart.Warning"
|
||||
|
||||
#define TW_THINK "CTeamTrainWatcherThink"
|
||||
#define TW_ALARM_THINK "CTeamTrainWatcherAlarmThink"
|
||||
#define TW_ALARM_THINK_INTERVAL 8.0
|
||||
|
||||
// #define TWMASTER_THINK "CTeamTrainWatcherMasterThink"
|
||||
|
||||
DECLARE_AUTO_LIST( ITFTeamTrainWatcher );
|
||||
|
||||
class CTeamTrainWatcher : public CBaseEntity, public CGameEventListener, public ITFTeamTrainWatcher
|
||||
class CTeamTrainWatcher : public CBaseEntity
|
||||
{
|
||||
DECLARE_CLASS( CTeamTrainWatcher, CBaseEntity );
|
||||
public:
|
||||
@@ -44,9 +34,7 @@ public:
|
||||
DECLARE_DATADESC();
|
||||
|
||||
CTeamTrainWatcher();
|
||||
~CTeamTrainWatcher();
|
||||
|
||||
virtual void UpdateOnRemove( void );
|
||||
virtual int UpdateTransmitState();
|
||||
|
||||
void InputRoundActivate( inputdata_t &inputdata );
|
||||
@@ -55,9 +43,6 @@ public:
|
||||
|
||||
void InputSetNumTrainCappers( inputdata_t &inputdata );
|
||||
void InputOnStartOvertime( inputdata_t &inputdata );
|
||||
void InputSetSpeedForwardModifier( inputdata_t &inputdata );
|
||||
void InputSetTrainRecedeTime( inputdata_t &inputdata );
|
||||
void InputSetTrainCanRecede( inputdata_t &inputdata );
|
||||
|
||||
// ==========================================================
|
||||
// given a start node and a list of goal nodes
|
||||
@@ -66,7 +51,6 @@ public:
|
||||
void WatcherActivate( void );
|
||||
|
||||
void WatcherThink( void );
|
||||
void WatcherAlarmThink( void );
|
||||
|
||||
CBaseEntity *GetTrainEntity( void );
|
||||
bool IsDisabled( void ) { return m_bDisabled; }
|
||||
@@ -75,41 +59,15 @@ public:
|
||||
|
||||
void StopCaptureAlarm( void );
|
||||
|
||||
void SetNumTrainCappers( int iNumCappers, CBaseEntity *pTrigger ); // only used for train watchers that control the train movement
|
||||
|
||||
virtual void FireGameEvent( IGameEvent * event );
|
||||
|
||||
int GetCapturerCount( void ) const; // return the number of players who are "capturing" the payload, or -1 if the payload is blocked
|
||||
|
||||
void ProjectPointOntoPath( const Vector &pos, Vector *posOnPath, float *distanceAlongPath ) const; // project the given position onto the track and return the point and how far along that projected position is
|
||||
bool IsAheadOfTrain( const Vector &pos ) const; // return true if the given position is farther down the track than the train is
|
||||
|
||||
bool IsTrainAtStart( void ) const; // return true if the train hasn't left its starting position yet
|
||||
bool IsTrainNearCheckpoint( void ) const; // return true if the train is almost at the next checkpoint
|
||||
|
||||
float GetTrainDistanceAlongTrack( void ) const;
|
||||
Vector GetNextCheckpointPosition( void ) const; // return world space location of next checkpoint along the path
|
||||
|
||||
#if defined( STAGING_ONLY ) && defined( TF_DLL )
|
||||
void DumpStats( void );
|
||||
#endif // STAGING_ONLY && TF_DLL
|
||||
|
||||
private:
|
||||
|
||||
void StartCaptureAlarm( CTeamControlPoint *pPoint );
|
||||
void PlayCaptureAlert( CTeamControlPoint *pPoint, bool bFinalPointInMap );
|
||||
void InternalSetNumTrainCappers( int iNumCappers, CBaseEntity *pTrigger );
|
||||
void InternalSetSpeedForwardModifier( float flModifier );
|
||||
#ifdef GLOWS_ENABLE
|
||||
void FindGlowEntity( void );
|
||||
#endif // GLOWS_ENABLE
|
||||
void HandleTrainMovement( bool bStartReceding = false );
|
||||
void HandleSparks( bool bSparks );
|
||||
|
||||
private:
|
||||
|
||||
bool m_bDisabled;
|
||||
bool m_bTrainCanRecede;
|
||||
|
||||
// === Data ===
|
||||
|
||||
// pointer to the train that we're checking
|
||||
@@ -143,8 +101,6 @@ private:
|
||||
float m_flTotalPathDistance; // calculated only at round start, node graph
|
||||
// may get chopped as the round progresses
|
||||
|
||||
float m_flTrainDistanceFromStart; // actual distance along path of train, for comparing against m_CPLinks[].flDistanceFromStart
|
||||
|
||||
float m_flSpeedLevels[3];
|
||||
|
||||
// === Networked Data ===
|
||||
@@ -166,65 +122,6 @@ private:
|
||||
|
||||
float m_flNextSpeakForwardConceptTime; // used to have players speak the forward concept every X seconds
|
||||
CHandle<CTriggerAreaCapture> m_hAreaCap;
|
||||
|
||||
CSoundPatch *m_pAlarm;
|
||||
float m_flAlarmEndTime;
|
||||
bool m_bAlarmPlayed;
|
||||
|
||||
// added for new mode where the train_watcher handles the train movement
|
||||
bool m_bHandleTrainMovement;
|
||||
string_t m_iszSparkName;
|
||||
CUtlVector< CHandle<CEnvSpark> > m_Sparks;
|
||||
float m_flSpeedForwardModifier;
|
||||
int m_iCurrentHillType;
|
||||
float m_flCurrentSpeed;
|
||||
bool m_bReceding;
|
||||
|
||||
int m_nTrainRecedeTime;
|
||||
|
||||
#ifdef GLOWS_ENABLE
|
||||
CNetworkVar( EHANDLE, m_hGlowEnt );
|
||||
#endif // GLOWS_ENABLE
|
||||
};
|
||||
|
||||
|
||||
inline float CTeamTrainWatcher::GetTrainDistanceAlongTrack( void ) const
|
||||
{
|
||||
return m_flTrainDistanceFromStart;
|
||||
}
|
||||
|
||||
inline int CTeamTrainWatcher::GetCapturerCount( void ) const
|
||||
{
|
||||
return m_nNumCappers;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
class CTeamTrainWatcherMaster : public CBaseEntity, public CGameEventListener
|
||||
{
|
||||
DECLARE_CLASS( CTeamTrainWatcherMaster, CBaseEntity );
|
||||
|
||||
public:
|
||||
CTeamTrainWatcherMaster();
|
||||
~CTeamTrainWatcherMaster();
|
||||
|
||||
void Precache( void );
|
||||
|
||||
private:
|
||||
void TWMThink( void );
|
||||
void FireGameEvent( IGameEvent *event );
|
||||
|
||||
bool FindTrainWatchers( void );
|
||||
|
||||
private:
|
||||
CTeamTrainWatcher *m_pBlueWatcher;
|
||||
CTeamTrainWatcher *m_pRedWatcher;
|
||||
|
||||
float m_flBlueProgress;
|
||||
float m_flRedProgress;
|
||||
};
|
||||
|
||||
extern EHANDLE g_hTeamTrainWatcherMaster;
|
||||
*/
|
||||
|
||||
#endif //TEAM_TRAIN_WATCHER_H
|
||||
|
||||
Reference in New Issue
Block a user