当前位置: 首页>>代码示例>>C++>>正文


C++ CBaseCombatCharacter::GetTeamNumber方法代码示例

本文整理汇总了C++中CBaseCombatCharacter::GetTeamNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseCombatCharacter::GetTeamNumber方法的具体用法?C++ CBaseCombatCharacter::GetTeamNumber怎么用?C++ CBaseCombatCharacter::GetTeamNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBaseCombatCharacter的用法示例。


在下文中一共展示了CBaseCombatCharacter::GetTeamNumber方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateLaserPointer

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CWeaponTranquilizer::CreateLaserPointer( void )
{
#ifndef CLIENT_DLL
	if ( m_hLaserDot != NULL )
		return;

	CBaseCombatCharacter *pOwner = GetOwner();
	
	if ( pOwner == NULL )
		return;

	if ( pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0 )
		return;

	m_hLaserDot = CLaserDot::Create( GetAbsOrigin(), GetOwner() );
	m_hLaserDot->TurnOff();
	m_hLaserDot->SetRenderMode(kRenderWorldGlow);
	if(HL2MPRules()->IsTeamplay())
	{
		if(pOwner->GetTeamNumber() == TEAM_PINK)
			m_hLaserDot->SetRenderColor(255,100,255,255);
		else
			m_hLaserDot->SetRenderColor(153,255,153,255);
	}
	else
		m_hLaserDot->SetRenderColor(255,0,0,255);

	UpdateLaserPosition();
#endif
}
开发者ID:Orygin,项目名称:BisounoursParty,代码行数:33,代码来源:weapon_tranquilizer.cpp

示例2: BeamBreakThink

void CTripmineGrenade::BeamBreakThink( void  )
{
	// See if I can go solid yet (has dropper moved out of way?)
	if (IsSolidFlagSet( FSOLID_NOT_SOLID ))
	{
		trace_t tr;
		Vector	vUpBit = GetAbsOrigin();
		vUpBit.z += 5.0;

		UTIL_TraceEntity( this, GetAbsOrigin(), vUpBit, MASK_SHOT, &tr );
		if ( !tr.startsolid && (tr.fraction == 1.0) )
		{
			RemoveSolidFlags( FSOLID_NOT_SOLID );
		}
	}

	trace_t tr;

	// NOT MASK_SHOT because we want only simple hit boxes
	UTIL_TraceLine( GetAbsOrigin(), m_vecEnd, MASK_SOLID, this, COLLISION_GROUP_NONE, &tr );

	// ALERT( at_console, "%f : %f\n", tr.flFraction, m_flBeamLength );

	// respawn detect. 
	if ( !m_pBeam )
	{
		MakeBeam( );
		if ( tr.m_pEnt )
			m_hOwner = tr.m_pEnt;	// reset owner too
	}


	CBaseEntity *pEntity = tr.m_pEnt;
	CBaseCombatCharacter *pBCC  = ToBaseCombatCharacter( pEntity );
	
	if (pBCC && pBCC->GetTeamNumber() != m_nTeam && pBCC->m_floatCloakFactor < 1.0f)
	//if (pBCC || fabs( m_flBeamLength - tr.fraction ) > 0.001)
	{
		m_iHealth = 0;
		Event_Killed( CTakeDamageInfo( (CBaseEntity*)m_hOwner, this, 100, GIB_NORMAL ) );
		

		return;
	}

	SetNextThink( gpGlobals->curtime + 0.05f );
}
开发者ID:rendenba,项目名称:source-sdk-2013,代码行数:47,代码来源:grenade_tripmine.cpp

示例3: CreateSniperDot

//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFSniperRifle::CreateSniperDot( void )
{
// Server specific.
#ifdef GAME_DLL

	// Check to see if we have already been created?
	if ( m_hSniperDot )
		return;

	// Get the owning player (make sure we have one).
	CBaseCombatCharacter *pPlayer = GetOwner();
	if ( !pPlayer )
		return;

	// Create the sniper dot, but do not make it visible yet.
	m_hSniperDot = CSniperDot::Create( GetAbsOrigin(), pPlayer, true );
	m_hSniperDot->ChangeTeam( pPlayer->GetTeamNumber() );

#endif
}
开发者ID:staticfox,项目名称:TF2Classic,代码行数:23,代码来源:tf_weapon_sniperrifle.cpp

示例4: LaunchRocket

//-----------------------------------------------------------------------------
// Purpose: Launch a bounce/impact grenade
//-----------------------------------------------------------------------------
void CGEWeaponRocketLauncher::LaunchRocket( void )
{
	CBaseCombatCharacter *pOwner = GetOwner();
	if ( !pOwner )
		return;

#ifndef CLIENT_DLL
	Vector	vForward, vRight, vUp;
	AngleVectors( pOwner->EyeAngles(), &vForward, &vRight, &vUp );

	// Manipulate the shoot position such that it is in front of our gun muzzle
	Vector vecSrc = pOwner->Weapon_ShootPosition();

	if ( pOwner->IsPlayer() )
	{
		VectorMA( vecSrc, 4.5f, vRight, vecSrc ); // 3.0, 5.0
		VectorMA( vecSrc, 16.5f, vForward, vecSrc ); // 20, 19
		VectorMA( vecSrc, -5.25f, vUp, vecSrc ); // -2, -6, -5, 5.25
	}
	else
	{
		VectorMA( vecSrc, 20.0, vForward, vecSrc );
	}

	CheckLaunchPosition( pOwner->EyePosition(), vecSrc );

	if ( pOwner->MyNPCPointer() )
		vForward = pOwner->MyNPCPointer()->GetActualShootTrajectory( vecSrc );

	QAngle angAiming;
	VectorAngles( vForward, angAiming );

	// Convert us into a bot player :-D
	if ( pOwner->IsNPC() )
	{
		CNPC_GEBase *pNPC = (CNPC_GEBase*) pOwner;
		if ( pNPC->GetBotPlayer() )
			pOwner = pNPC->GetBotPlayer();
	}
	
	CGERocket *pRocket = (CGERocket*)CBaseEntity::Create( "npc_rocket", vecSrc, angAiming, NULL );

	if ( pRocket )
	{
		pRocket->SetThrower( pOwner );
		pRocket->SetOwnerEntity( pOwner );
		pRocket->SetSourceWeapon(this);

		pRocket->SetDamage( GetGEWpnData().m_iDamage );
		pRocket->SetDamageRadius( GetGEWpnData().m_flDamageRadius );

		if (pOwner->GetTeamNumber() == TEAM_JANUS)
			pRocket->SetCollisionGroup( COLLISION_GROUP_GRENADE_JANUS );
		else if (pOwner->GetTeamNumber() == TEAM_MI6)
			pRocket->SetCollisionGroup( COLLISION_GROUP_GRENADE_MI6 );

		// Tell the owner what we threw to implement anti-spamming
		if ( pOwner->IsPlayer() )
			ToGEMPPlayer( pOwner )->AddThrownObject( pRocket );
	}
#endif

	// Remove the rocket from our ammo pool
	m_iClip1 -= 1;
	WeaponSound( SINGLE );

	SwitchBodygroup(1, 1);

	//Add our view kick in
	AddViewKick();
}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:74,代码来源:weapon_rocket_launcher.cpp


注:本文中的CBaseCombatCharacter::GetTeamNumber方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。