Beispiel #1
0
//------------------------------------------------
// Spawn
//------------------------------------------------
void CPropAPC::Spawn( void )
{
	BaseClass::Spawn();
	SetBlocksLOS( true );
	m_iHealth = m_iMaxHealth = sk_apc_health.GetFloat();
	SetCycle( 0 );
	m_iMachineGunBurstLeft = MACHINE_GUN_BURST_SIZE;
	m_iRocketSalvoLeft = ROCKET_SALVO_SIZE;
	m_nRocketSide = 0;
	m_lifeState = LIFE_ALIVE;
	m_bInFiringCone = false;

	m_flHandbrakeTime = gpGlobals->curtime + 0.1;
	m_bInitialHandbrake = false;

	// Reset the gun to a default pose.
	SetPoseParameter( "vehicle_weapon_pitch", 0 );
	SetPoseParameter( "vehicle_weapon_yaw", 90 );

	CreateAPCLaserDot();

	if ( IsXbox() )
	{
		AddFlag( FL_AIMTARGET );
	}
}
//------------------------------------------------
// Spawn
//------------------------------------------------
void CPropAPC2::Spawn( void )
{
	SetVehicleType( VEHICLE_TYPE_CAR_WHEELS );
	BaseClass::Spawn();
	SetBlocksLOS( true );
	m_iHealth = m_iMaxHealth = 500;
	m_iAmmoCount=30; // Balas seguidas que podemos disparar
	m_iCannonCount=100; // Tanto por cien de cañon.
	SetCycle( 0 );
	m_iMachineGunBurstLeft = MACHINE_GUN_BURST_SIZE;
	m_iRocketSalvoLeft = ROCKET_SALVO_SIZE;
	m_fReloadTime=gpGlobals->curtime+0.5f;
	m_fCannonCharge=gpGlobals->curtime+0.05f;
	m_nRocketSide = 0;
	m_lifeState = LIFE_ALIVE;
	m_bInFiringCone = false;

	m_flHandbrakeTime = gpGlobals->curtime + 0.1;
	m_bInitialHandbrake = false;

	// Reset the gun to a default pose.
	SetPoseParameter( "vehicle_weapon_pitch", 0 );
	SetPoseParameter( "vehicle_weapon_yaw", 90 );
	AddSolidFlags( FSOLID_NOT_STANDABLE );
	m_vOriginalSpawnOrigin = GetAbsOrigin();
	m_vOriginalSpawnAngles = GetAbsAngles();
	m_bSpawn=false;
	CreateAPCLaserDot();
}
Beispiel #3
0
//-----------------------------------------------------------------------------
// Aims the secondary weapon at a target 
//-----------------------------------------------------------------------------
void CPropAPC::AimSecondaryWeaponAt( CBaseEntity *pTarget )
{
	m_hRocketTarget = pTarget;

	// Update the rocket target
	CreateAPCLaserDot();

	if ( m_hRocketTarget )
	{
		m_hLaserDot->SetAbsOrigin( m_hRocketTarget->BodyTarget( WorldSpaceCenter(), false ) );
	}
	SetLaserDotTarget( m_hLaserDot, m_hRocketTarget );
	EnableLaserDot( m_hLaserDot, m_hRocketTarget != NULL );
}
void CPropAPC2::AimSecondaryWeapon(Vector &vecWorldTarget )
{
	//m_hRocketTarget = vecWorldTarget;

	// Update the rocket target
	CreateAPCLaserDot();

	if ( m_hRocketTarget )
	{
		m_hLaserDot->SetAbsOrigin( m_hRocketTarget->BodyTarget( WorldSpaceCenter(), false ) );
	}
	SetLaserDotTarget( m_hLaserDot, m_hRocketTarget );
	EnableLaserDot( m_hLaserDot, m_hRocketTarget != NULL );
}