コード例 #1
0
//-----------------------------------------------------------------------------
// Here's where we deal with weapons, ladders, etc.
//-----------------------------------------------------------------------------
void CVehicleTeleportStation::OnItemPostFrame( CBaseTFPlayer *pDriver )
{
	// I can't do anything if I'm not active
	if ( !ShouldBeActive() )
		return;

	if ( GetPassengerRole( pDriver ) != VEHICLE_DRIVER )
		return;

	if ( !IsDeployed() && ( pDriver->m_afButtonPressed & IN_ATTACK ) )
	{
		if ( ValidDeployPosition() )
		{
			Deploy();
		}
	}
	else if ( IsDeployed() && ( pDriver->m_afButtonPressed & IN_ATTACK ) )
	{
		UnDeploy();

		SetControlPanelsActive( false );
		SetBodygroup( 1, true );
		RemoveCornerSprites();
		SetContextThink( NULL, 0, TELEPORT_STATION_THINK_CONTEXT );
	}
}
コード例 #2
0
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CVehicleSiegeTower::InternalUnDeploy( void )
{
	// Undeploy
	UnDeploy();
	InputTurnOn( inputdata_t() );

	// Destory the ladder.
	DestroyLadder();
}
コード例 #3
0
bool CVehicleMortar::ClientCommand( CBaseTFPlayer *pPlayer, const char *pCmd, ICommandArguments *pArg )
{
	ResetDeteriorationTime();

	if ( !Q_stricmp( pCmd, "Deploy" ) )
	{
		Deploy();
		return true;
	}
	else if ( !Q_stricmp( pCmd, "Undeploy" ) )
	{
		UnDeploy();
	}
	else if ( !Q_stricmp( pCmd, "CancelDeploy" ) )
	{
		CancelDeploy();
		return true;
	}
	else if ( !Q_stricmp( pCmd, "FireMortar" ) )
	{
		if ( pArg->Argc() == 3 )
		{
			FireMortar( atof( pArg->Argv(1) ), atof( pArg->Argv(2) ), false, false );
		}
		return true;
	}
	else if ( !Q_stricmp( pCmd, "MortarYaw" ) )
	{
		if ( pArg->Argc() == 2 )
		{
			m_flMortarYaw = atof( pArg->Argv(1) );
		}
		return true;
	}

	return BaseClass::ClientCommand( pPlayer, pCmd, pArg );
}