//=========================================================
// activitylist.cpp
//=========================================================
#include "cbase.h"
#include "ai_activity.h"
#include "activitylist.h"
#include "stringregistry.h"

// NOTE: If CStringRegistry allowed storing arbitrary data, we could just use that.
// in this case we have the "isPrivate" member and the replacement rules 
// (activityIndex can be reused by private activities), so a custom table is necessary
struct activitylist_t
{
	int					activityIndex;
	unsigned short		stringKey;
	short				isPrivate;
};

CUtlVector<activitylist_t> g_ActivityList;

// This stores the actual activity names.  Also, the string ID in the registry is simply an index 
// into the g_ActivityList array.
CStringRegistry	g_ActivityStrings;

// this is just here to accelerate adds
static int g_HighestActivity = 0;


void ActivityList_Init( void )
{
	g_HighestActivity = 0;
}

void ActivityList_Free( void )
{
	g_ActivityStrings.ClearStrings();
	g_ActivityList.Purge();
}

// add a new activity to the database
activitylist_t *ActivityList_AddActivityEntry( const char *pName, int iActivityIndex, bool isPrivate )
{
	int index = g_ActivityList.AddToTail();
	activitylist_t *pList = &g_ActivityList[index];
	pList->activityIndex = iActivityIndex;
	pList->stringKey = g_ActivityStrings.AddString( pName, index );
	pList->isPrivate = isPrivate;
	
	// UNDONE: This implies that ALL shared activities are added before ANY custom activities
	// UNDONE: Segment these instead?  It's a 32-bit int, how many activities do we need?
	if ( iActivityIndex > g_HighestActivity )
	{
		g_HighestActivity = iActivityIndex;
	}

	return pList;
}

// get the database entry from a string
static activitylist_t *ListFromString( const char *pString )
{
	// just use the string registry to do this search/map
	int stringID = g_ActivityStrings.GetStringID( pString );
	if ( stringID < 0 )
		return NULL;

	return &g_ActivityList[stringID];
}

// Get the database entry for an index
static activitylist_t *ListFromActivity( int activityIndex )
{
	// ugly linear search
	for ( int i = 0; i < g_ActivityList.Size(); i++ )
	{
		if ( g_ActivityList[i].activityIndex == activityIndex )
		{
			return &g_ActivityList[i];
		}
	}

	return NULL;
}

bool ActivityList_RegisterSharedActivity( const char *pszActivityName, int iActivityIndex )
{
	// UNDONE: Do we want to do these checks when not in developer mode? or maybe DEBUG only?
	// They really only matter when you change the list of code controlled activities.  IDs
	// for content controlled activities never collide because they are generated.

	// first, check to make sure the slot we're asking for is free. It must be for 
	// a shared activity.
	activitylist_t *pList = ListFromString( pszActivityName );
	if ( !pList )
	{
		pList = ListFromActivity( iActivityIndex );
	}

	if ( pList )
	{
		Warning( "***\nShared activity collision! %s<->%s\n***\n", pszActivityName, g_ActivityStrings.GetStringForKey( pList->stringKey ) );
		Assert(0);
		return false;
	}
	// ----------------------------------------------------------------

	ActivityList_AddActivityEntry( pszActivityName, iActivityIndex, false );
	return true;
}


Activity ActivityList_RegisterPrivateActivity( const char *pszActivityName )
{
	activitylist_t *pList = ListFromString( pszActivityName );
	if ( pList )
	{
		// this activity is already in the list. If the activity we collided with is also private, 
		// then the collision is OK. Otherwise, it's a bug.
		if ( pList->isPrivate )
		{
			return (Activity)pList->activityIndex;
		}
		else
		{
			// this private activity collides with a shared activity. That is not allowed.
			Warning( "***\nShared<->Private Activity collision!\n***\n" );
			Assert(0);
			return ACT_INVALID;
		}
	}

	pList = ActivityList_AddActivityEntry( pszActivityName, g_HighestActivity+1, true );
	return (Activity)pList->activityIndex;
}

// Get the index for a given activity name
// Done at load time for all models
int ActivityList_IndexForName( const char *pszActivityName )
{
	// this is a fast O(lgn) search (actually does 2 O(lgn) searches)
	activitylist_t *pList = ListFromString( pszActivityName );

	if ( pList )
	{
		return pList->activityIndex;
	}

	return -1;
}

// Get the name for a given index
// This should only be used in debug code, it does a linear search
// But at least it only compares integers
const char *ActivityList_NameForIndex( int activityIndex )
{
	activitylist_t *pList = ListFromActivity( activityIndex );
	if ( pList )
	{
		return g_ActivityStrings.GetStringForKey( pList->stringKey );
	}
	return NULL;
}

void ActivityList_RegisterSharedActivities( void )
{
	REGISTER_SHARED_ACTIVITY( ACT_RESET );
	REGISTER_SHARED_ACTIVITY( ACT_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_COVER );
	REGISTER_SHARED_ACTIVITY( ACT_COVER_MED );
	REGISTER_SHARED_ACTIVITY( ACT_COVER_LOW );
	REGISTER_SHARED_ACTIVITY( ACT_WALK );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_AIM );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_CROUCH );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_CROUCH_AIM );
	REGISTER_SHARED_ACTIVITY( ACT_RUN );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_AIM );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_CROUCH );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_CROUCH_AIM );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_PROTECTED );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK1 );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK2 );
	REGISTER_SHARED_ACTIVITY( ACT_DIESIMPLE );
	REGISTER_SHARED_ACTIVITY( ACT_DIEBACKWARD );
	REGISTER_SHARED_ACTIVITY( ACT_DIEFORWARD );
	REGISTER_SHARED_ACTIVITY( ACT_DIEVIOLENT );
	REGISTER_SHARED_ACTIVITY( ACT_DIERAGDOLL );
	REGISTER_SHARED_ACTIVITY( ACT_FLY );
	REGISTER_SHARED_ACTIVITY( ACT_HOVER );
	REGISTER_SHARED_ACTIVITY( ACT_GLIDE );
	REGISTER_SHARED_ACTIVITY( ACT_SWIM );
	REGISTER_SHARED_ACTIVITY( ACT_JUMP );
	REGISTER_SHARED_ACTIVITY( ACT_HOP );
	REGISTER_SHARED_ACTIVITY( ACT_LEAP );
	REGISTER_SHARED_ACTIVITY( ACT_LAND );
	REGISTER_SHARED_ACTIVITY( ACT_CLIMB_UP );
	REGISTER_SHARED_ACTIVITY( ACT_CLIMB_DOWN );
	REGISTER_SHARED_ACTIVITY( ACT_STRAFE_LEFT );
	REGISTER_SHARED_ACTIVITY( ACT_STRAFE_RIGHT );
	REGISTER_SHARED_ACTIVITY( ACT_ROLL_LEFT );
	REGISTER_SHARED_ACTIVITY( ACT_ROLL_RIGHT );
	REGISTER_SHARED_ACTIVITY( ACT_TURN_LEFT );
	REGISTER_SHARED_ACTIVITY( ACT_TURN_RIGHT );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCH );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHIDLE );
	REGISTER_SHARED_ACTIVITY( ACT_STAND );
	REGISTER_SHARED_ACTIVITY( ACT_USE );
	REGISTER_SHARED_ACTIVITY( ACT_SIGNAL1 );
	REGISTER_SHARED_ACTIVITY( ACT_SIGNAL2 );
	REGISTER_SHARED_ACTIVITY( ACT_SIGNAL3 );
	REGISTER_SHARED_ACTIVITY( ACT_LOOKBACK_LEFT );
	REGISTER_SHARED_ACTIVITY( ACT_LOOKBACK_RIGHT );
	REGISTER_SHARED_ACTIVITY( ACT_COWER );
	REGISTER_SHARED_ACTIVITY( ACT_SMALL_FLINCH );
	REGISTER_SHARED_ACTIVITY( ACT_BIG_FLINCH );
	REGISTER_SHARED_ACTIVITY( ACT_MELEE_ATTACK1 );
	REGISTER_SHARED_ACTIVITY( ACT_MELEE_ATTACK2 );
	REGISTER_SHARED_ACTIVITY( ACT_RELOAD );
	REGISTER_SHARED_ACTIVITY( ACT_RELOAD_LOW );
	REGISTER_SHARED_ACTIVITY( ACT_ARM );
	REGISTER_SHARED_ACTIVITY( ACT_DISARM );
	REGISTER_SHARED_ACTIVITY( ACT_PICKUP_GROUND );
	REGISTER_SHARED_ACTIVITY( ACT_IDLE_ANGRY );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_HURT );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_HURT );
	REGISTER_SHARED_ACTIVITY( ACT_SPECIAL_ATTACK1 );
	REGISTER_SHARED_ACTIVITY( ACT_SPECIAL_ATTACK2 );
	REGISTER_SHARED_ACTIVITY( ACT_COMBAT_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_SCARED );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_SCARED );
	REGISTER_SHARED_ACTIVITY( ACT_VICTORY_DANCE );
	REGISTER_SHARED_ACTIVITY( ACT_DIE_HEADSHOT );
	REGISTER_SHARED_ACTIVITY( ACT_DIE_CHESTSHOT );
	REGISTER_SHARED_ACTIVITY( ACT_DIE_GUTSHOT );
	REGISTER_SHARED_ACTIVITY( ACT_DIE_BACKSHOT );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_HEAD );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_CHEST );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_STOMACH );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_LEFTARM );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_RIGHTARM );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_LEFTLEG );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_RIGHTLEG );
	REGISTER_SHARED_ACTIVITY( ACT_FLINCH_PHYSICS );

	REGISTER_SHARED_ACTIVITY( ACT_IDLE_ON_FIRE );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_ON_FIRE );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_ON_FIRE );

	REGISTER_SHARED_ACTIVITY( ACT_RAPPEL_LOOP );

	REGISTER_SHARED_ACTIVITY( ACT_180_LEFT );
	REGISTER_SHARED_ACTIVITY( ACT_STEP_LEFT );			
	REGISTER_SHARED_ACTIVITY( ACT_STEP_RIGHT );
	REGISTER_SHARED_ACTIVITY( ACT_STEP_BACK );
	REGISTER_SHARED_ACTIVITY( ACT_STEP_FORE );

	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK1 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK2 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_MELEE_ATTACK1 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_MELEE_ATTACK2 );

	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_SMALL_FLINCH );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_BIG_FLINCH );

	// registered for Half-Life HGRUNT compatability
	REGISTER_SHARED_ACTIVITY( ACT_BARNACLE_HIT );
	REGISTER_SHARED_ACTIVITY( ACT_BARNACLE_PULL );
	REGISTER_SHARED_ACTIVITY( ACT_BARNACLE_CHOMP );
	REGISTER_SHARED_ACTIVITY( ACT_BARNACLE_CHEW );

	// weapon override activities
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_AR1 );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_AR2 );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_AR2_GRENADE );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_HMG1 );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_ML );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_SMG1 );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_SMG1_LOW );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_SMG2 );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_SHOTGUN );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_PISTOL );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_PISTOL_LOW );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_SLAM );
	REGISTER_SHARED_ACTIVITY( ACT_RANGE_ATTACK_THROW );
	REGISTER_SHARED_ACTIVITY( ACT_MELEE_ATTACK_SWING );

	// weapon override activities
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_AR1 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_AR2 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_AR2_GRENADE );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_HMG1 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_ML );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_SMG1 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_SMG1_LOW );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_SMG2 );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_SHOTGUN );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_PISTOL );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_PISTOL_LOW );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_SLAM );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_RANGE_ATTACK_THROW );
	REGISTER_SHARED_ACTIVITY( ACT_GESTURE_MELEE_ATTACK_SWING );


	REGISTER_SHARED_ACTIVITY( ACT_IDLE_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_IDLE_SMG1 );
	REGISTER_SHARED_ACTIVITY( ACT_IDLE_ANGRY_SMG1 );
	REGISTER_SHARED_ACTIVITY( ACT_IDLE_PISTOL );
	REGISTER_SHARED_ACTIVITY( ACT_IDLE_ANGRY_PISTOL );

	REGISTER_SHARED_ACTIVITY( ACT_WALK_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_AIM_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_CROUCH_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_WALK_CROUCH_AIM_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_AIM_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_CROUCH_RIFLE );
	REGISTER_SHARED_ACTIVITY( ACT_RUN_CROUCH_AIM_RIFLE );

	// Reloads
	REGISTER_SHARED_ACTIVITY( ACT_RELOAD_PISTOL );
	REGISTER_SHARED_ACTIVITY( ACT_RELOAD_PISTOL_LOW );
	REGISTER_SHARED_ACTIVITY( ACT_RELOAD_SMG1 );
	REGISTER_SHARED_ACTIVITY( ACT_RELOAD_SMG1_LOW );

	// Viewmodel activities may belong elsewhere, but since where is unclear right now,
	// they'll be placed here.
	REGISTER_SHARED_ACTIVITY( ACT_VM_DRAW );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HOLSTER );
	REGISTER_SHARED_ACTIVITY( ACT_VM_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_VM_FIDGET );
	REGISTER_SHARED_ACTIVITY( ACT_VM_PULLBACK );
	REGISTER_SHARED_ACTIVITY( ACT_VM_THROW );
	REGISTER_SHARED_ACTIVITY( ACT_VM_PULLPIN );
	REGISTER_SHARED_ACTIVITY( ACT_VM_PRIMARYATTACK );
	REGISTER_SHARED_ACTIVITY( ACT_VM_SECONDARYATTACK );
	REGISTER_SHARED_ACTIVITY( ACT_VM_RELOAD );
	REGISTER_SHARED_ACTIVITY( ACT_VM_DRYFIRE );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HITLEFT );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HITLEFT2 );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HITRIGHT );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HITRIGHT2 );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HITCENTER );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HITCENTER2 );
	REGISTER_SHARED_ACTIVITY( ACT_VM_MISSLEFT );
	REGISTER_SHARED_ACTIVITY( ACT_VM_MISSLEFT2 );
	REGISTER_SHARED_ACTIVITY( ACT_VM_MISSRIGHT );
	REGISTER_SHARED_ACTIVITY( ACT_VM_MISSRIGHT2 );
	REGISTER_SHARED_ACTIVITY( ACT_VM_MISSCENTER );
	REGISTER_SHARED_ACTIVITY( ACT_VM_MISSCENTER2 );
	REGISTER_SHARED_ACTIVITY( ACT_VM_HAULBACK );
	REGISTER_SHARED_ACTIVITY( ACT_VM_SWINGHARD );
	REGISTER_SHARED_ACTIVITY( ACT_VM_SWINGMISS );
	REGISTER_SHARED_ACTIVITY( ACT_VM_SWINGHIT );

	REGISTER_SHARED_ACTIVITY( ACT_VM_IDLE_TO_LOWERED );
	REGISTER_SHARED_ACTIVITY( ACT_VM_IDLE_LOWERED );
	REGISTER_SHARED_ACTIVITY( ACT_VM_LOWERED_TO_IDLE );

//===========================
// HL2 Specific Activities
//===========================
	// SLAM Specialty Activites
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_IDLE);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_ND_IDLE);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_ATTACH);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_ATTACH2);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_ND_ATTACH);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_ND_ATTACH2);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_DETONATE);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_DETONATOR_HOLSTER);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_DRAW); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_ND_DRAW); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_TO_THROW); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_TO_THROW_ND); 
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_STICKWALL_TO_TRIPMINE_ND );
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_IDLE);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_ND_IDLE);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_THROW);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_THROW2);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_THROW_ND);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_THROW_ND2);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_DETONATE);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_DETONATOR_HOLSTER);
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_DRAW); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_ND_DRAW); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_TO_STICKWALL); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_TO_STICKWALL_ND); 
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_THROW_TO_TRIPMINE_ND );
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_TRIPMINE_IDLE);
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_TRIPMINE_DRAW);
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_TRIPMINE_ATTACH); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_TRIPMINE_ATTACH2); 
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_TRIPMINE_TO_STICKWALL_ND );
	REGISTER_SHARED_ACTIVITY( ACT_SLAM_TRIPMINE_TO_THROW_ND );
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_DETONATOR_IDLE); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_DETONATOR_DRAW); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_DETONATOR_DETONATE);
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_DETONATOR_HOLSTER);
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_DETONATOR_STICKWALL_DRAW); 
  	REGISTER_SHARED_ACTIVITY( ACT_SLAM_DETONATOR_THROW_DRAW); 

	// SHOTGUN specialty activities
	REGISTER_SHARED_ACTIVITY( ACT_SHOTGUN_RELOAD_START);
	REGISTER_SHARED_ACTIVITY( ACT_SHOTGUN_RELOAD_FINISH);
	REGISTER_SHARED_ACTIVITY( ACT_SHOTGUN_PUMP);

	// SMG2 special activities
	REGISTER_SHARED_ACTIVITY( ACT_SMG2_IDLE2 );
	REGISTER_SHARED_ACTIVITY( ACT_SMG2_FIRE2 );
	REGISTER_SHARED_ACTIVITY( ACT_SMG2_DRAW2 );
	REGISTER_SHARED_ACTIVITY( ACT_SMG2_RELOAD2 );
	REGISTER_SHARED_ACTIVITY( ACT_SMG2_DRYFIRE2 );
	REGISTER_SHARED_ACTIVITY( ACT_SMG2_TOAUTO );
	REGISTER_SHARED_ACTIVITY( ACT_SMG2_TOBURST );

//===========================
// TF2 Specific Activities
//===========================
	REGISTER_SHARED_ACTIVITY( ACT_STARTDYING );
	REGISTER_SHARED_ACTIVITY( ACT_DYINGLOOP );
	REGISTER_SHARED_ACTIVITY( ACT_DYINGTODEAD );
	REGISTER_SHARED_ACTIVITY( ACT_RIDE_MANNED_GUN );

	// All viewmodels
	REGISTER_SHARED_ACTIVITY( ACT_VM_SPRINT_ENTER );
	REGISTER_SHARED_ACTIVITY( ACT_VM_SPRINT_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_VM_SPRINT_LEAVE );

	// Looping weapon firing
	REGISTER_SHARED_ACTIVITY( ACT_FIRE_START );
	REGISTER_SHARED_ACTIVITY( ACT_FIRE_LOOP );
	REGISTER_SHARED_ACTIVITY( ACT_FIRE_END );

	// TF2
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_GRENADEIDLE );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_GRENADEREADY );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_PRIMARYATTACK );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_GRENADEIDLE );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_GRENADEREADY );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_PRIMARYATTACK );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_SHIELD_UP );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_SHIELD_DOWN );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_SHIELD_UP_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_SHIELD_ATTACK );
	REGISTER_SHARED_ACTIVITY( ACT_OVERLAY_SHIELD_KNOCKBACK );
	REGISTER_SHARED_ACTIVITY( ACT_SHIELD_UP );
	REGISTER_SHARED_ACTIVITY( ACT_SHIELD_DOWN );
	REGISTER_SHARED_ACTIVITY( ACT_SHIELD_UP_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_SHIELD_ATTACK );
	REGISTER_SHARED_ACTIVITY( ACT_SHIELD_KNOCKBACK );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_SHIELD_UP );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_SHIELD_DOWN );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_SHIELD_UP_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_SHIELD_ATTACK );
	REGISTER_SHARED_ACTIVITY( ACT_CROUCHING_SHIELD_KNOCKBACK );

	REGISTER_SHARED_ACTIVITY( ACT_TURNRIGHT45 );
	REGISTER_SHARED_ACTIVITY( ACT_TURNLEFT45 );

	REGISTER_SHARED_ACTIVITY( ACT_TURN );

	REGISTER_SHARED_ACTIVITY( ACT_OBJ_ASSEMBLING );
	REGISTER_SHARED_ACTIVITY( ACT_OBJ_DISMANTLING );
	REGISTER_SHARED_ACTIVITY( ACT_OBJ_STARTUP );
	REGISTER_SHARED_ACTIVITY( ACT_OBJ_RUNNING );
	REGISTER_SHARED_ACTIVITY( ACT_OBJ_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_OBJ_PLACING );
	REGISTER_SHARED_ACTIVITY( ACT_OBJ_DETERIORATING );

	// Deploy
	REGISTER_SHARED_ACTIVITY( ACT_DEPLOY );
	REGISTER_SHARED_ACTIVITY( ACT_DEPLOY_IDLE );
	REGISTER_SHARED_ACTIVITY( ACT_UNDEPLOY );

//===========================
// HL1 Specific Activities
//===========================

	// Grenades
	REGISTER_SHARED_ACTIVITY( ACT_GRENADE_ROLL );
	REGISTER_SHARED_ACTIVITY( ACT_GRENADE_TOSS );

	// Hand grenade
	REGISTER_SHARED_ACTIVITY( ACT_HANDGRENADE_THROW1 );
	REGISTER_SHARED_ACTIVITY( ACT_HANDGRENADE_THROW2 );
	REGISTER_SHARED_ACTIVITY( ACT_HANDGRENADE_THROW3 );

	// Shotgun
	REGISTER_SHARED_ACTIVITY( ACT_SHOTGUN_IDLE_DEEP );
	REGISTER_SHARED_ACTIVITY( ACT_SHOTGUN_IDLE4 );

	// Glock
	REGISTER_SHARED_ACTIVITY( ACT_GLOCK_SHOOTEMPTY );
	REGISTER_SHARED_ACTIVITY( ACT_GLOCK_SHOOT_RELOAD );

	// RPG
	REGISTER_SHARED_ACTIVITY( ACT_RPG_DRAW_UNLOADED );
	REGISTER_SHARED_ACTIVITY( ACT_RPG_HOLSTER_UNLOADED );
	REGISTER_SHARED_ACTIVITY( ACT_RPG_IDLE_UNLOADED );
	REGISTER_SHARED_ACTIVITY( ACT_RPG_FIDGET_UNLOADED );

	// Crossbow
	REGISTER_SHARED_ACTIVITY( ACT_CROSSBOW_DRAW_UNLOADED );
	REGISTER_SHARED_ACTIVITY( ACT_CROSSBOW_IDLE_UNLOADED );
	REGISTER_SHARED_ACTIVITY( ACT_CROSSBOW_FIDGET_UNLOADED );

	// Gauss
	REGISTER_SHARED_ACTIVITY( ACT_GAUSS_SPINUP );
	REGISTER_SHARED_ACTIVITY( ACT_GAUSS_SPINCYCLE );

	// Tripmine
	REGISTER_SHARED_ACTIVITY( ACT_TRIPMINE_GROUND );
	REGISTER_SHARED_ACTIVITY( ACT_TRIPMINE_WORLD );
}
