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


C++ CCSPlayer::GetFlags方法代码示例

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


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

示例1: PrimaryAttack

void CWeaponUSP::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();
	if ( !pPlayer )
		return;

	if ( m_bSilencerOn )
	{
		if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
			USPFire( 1.3f * (1 - m_flAccuracy) );
		else if (pPlayer->GetAbsVelocity().Length2D() > 5)
			USPFire( 0.25f * (1 - m_flAccuracy) );
		else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
			USPFire( 0.125f * (1 - m_flAccuracy) );
		else
			USPFire( 0.15f * (1 - m_flAccuracy) );
	}
	else
	{
		if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
			USPFire( 1.2f * (1 - m_flAccuracy ) );
		else if (pPlayer->GetAbsVelocity().Length2D() > 5)
			USPFire( 0.225f * (1 - m_flAccuracy) );
		else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
			USPFire( 0.08f * (1 - m_flAccuracy) );
		else
			USPFire( 0.1f * (1 - m_flAccuracy) );
	}

}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:30,代码来源:weapon_usp.cpp

示例2: PrimaryAttack

void CWeaponUSP::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();

	if ( m_bSilencerOn )
	{
		if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
			USPFire( (1.3) * (1 - m_flAccuracy), 0.225, false );
		else if (pPlayer->GetAbsVelocity().Length2D() > 0)
			USPFire( (0.25) * (1 - m_flAccuracy), 0.225, false );
		else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
			USPFire( (0.125) * (1 - m_flAccuracy), 0.225, false );
		else
			USPFire( (0.15) * (1 - m_flAccuracy), 0.225, false );
	}
	else
	{
		if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
			USPFire( (1.2) * (1 - m_flAccuracy), 0.225, false );
		else if (pPlayer->GetAbsVelocity().Length2D() > 0)
			USPFire( (0.225) * (1 - m_flAccuracy), 0.225, false );
		else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
			USPFire( (0.08) * (1 - m_flAccuracy), 0.225, false );
		else
			USPFire( (0.1) * (1 - m_flAccuracy), 0.225, false );
	}

}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:28,代码来源:weapon_usp.cpp

示例3: if

void CWeaponM4A1::M4A1Fire( float flSpread, float flCycleTime )
{
	if ( !CSBaseGunFire( flSpread, flCycleTime ) )
		return;

	CCSPlayer *pPlayer = GetPlayerOwner();
	if (pPlayer->GetAbsVelocity().Length2D() > 0)
		KickBack (1.0, 0.45, 0.28, 0.045, 3.75, 3, 7);
	else if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		KickBack (1.2, 0.5, 0.23, 0.15, 5.5, 3.5, 6);
	else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
		KickBack (0.6, 0.3, 0.2, 0.0125, 3.25, 2, 7);
	else
		KickBack (0.65, 0.35, 0.25, 0.015, 3.5, 2.25, 7);
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:15,代码来源:weapon_m4a1.cpp

示例4: if

void CWeaponSG552::SG552Fire( float flSpread, float flCycleTime )
{
	if ( !CSBaseGunFire( flSpread, flCycleTime ) )
		return;

	CCSPlayer *pPlayer = GetPlayerOwner();
	if (pPlayer->GetAbsVelocity().Length2D() > 0)
		KickBack (1, 0.45, 0.28, 0.04, 4.25, 2.5, 7);
	else if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		KickBack (1.25, 0.45, 0.22, 0.18, 6, 4, 5);
	else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
		KickBack (0.6, 0.35, 0.2, 0.0125, 3.7, 2, 10);
	else
		KickBack (0.625, 0.375, 0.25, 0.0125, 4, 2.25, 9);
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:15,代码来源:weapon_sg552.cpp

示例5: PrimaryAttack

void CDEagle::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();
	
	if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		DEAGLEFire( (1.5) * (1 - m_flAccuracy), 0.3, false );
	
	else if (pPlayer->GetAbsVelocity().Length2D() > 0)
		DEAGLEFire( (0.25) * (1 - m_flAccuracy), 0.3, false );
	
	else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
		DEAGLEFire( (0.115) * (1 - m_flAccuracy), 0.3, false );
	
	else
		DEAGLEFire( (0.13) * (1 - m_flAccuracy), 0.3, false );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:16,代码来源:weapon_deagle.cpp

示例6: if

void CWeaponG3SG1::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();
	
	if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		G3SG1Fire( (0.45) * (1 - m_flAccuracy), 0.25, false );
	
	else if (pPlayer->GetAbsVelocity().Length2D() > 0)
		G3SG1Fire( 0.15, 0.25, false );
	
	else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
		G3SG1Fire( (0.035) * (1 - m_flAccuracy), 0.25, false );
	
	else
		G3SG1Fire( (0.055) * (1 - m_flAccuracy), 0.25, false );
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:16,代码来源:weapon_g3sg1.cpp

示例7: PrimaryAttack

void CWeaponScout::PrimaryAttack( void )
{
    CCSPlayer *pPlayer = GetPlayerOwner();
    if (pPlayer == NULL)
    {
        Assert(pPlayer != NULL);
        return;
    }

    if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
        SCOUTFire( 0.2 );
    else if (pPlayer->GetAbsVelocity().Length2D() > 170)
        SCOUTFire( 0.075 );
    else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
        SCOUTFire( 0.0 );
    else
        SCOUTFire( 0.007 );
}
开发者ID:steadyfield,项目名称:SourceEngine2007,代码行数:18,代码来源:weapon_scout.cpp

示例8: PrimaryAttack

void CWeaponElite::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();
	if ( !pPlayer )
		return;

	if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		ELITEFire( 1.3f * (1 - m_flAccuracy) );
	
	else if (pPlayer->GetAbsVelocity().Length2D() > 5)
		ELITEFire( 0.175f * (1 - m_flAccuracy) );
	
	else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
		ELITEFire( 0.08f * (1 - m_flAccuracy) );
	
	else
		ELITEFire( 0.1f * (1 - m_flAccuracy));
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:18,代码来源:weapon_elite.cpp

示例9: if

void CAK47::AK47Fire( float flSpread )
{
	if ( !CSBaseGunFire( flSpread, GetCSWpnData().m_flCycleTime, true ) )
		return;

	CCSPlayer *pPlayer = GetPlayerOwner();

	// CSBaseGunFire can kill us, forcing us to drop our weapon, if we shoot something that explodes
	if ( !pPlayer )
		return;

	if (pPlayer->GetAbsVelocity().Length2D() > 5 )
		pPlayer->KickBack ( 1.5, 0.45, 0.225, 0.05, 6.5, 2.5, 7 );
	else if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		pPlayer->KickBack ( 2, 1.0, 0.5, 0.35, 9, 6, 5 );
	else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
		pPlayer->KickBack ( 0.9, 0.35, 0.15, 0.025, 5.5, 1.5, 9 );
	else
		pPlayer->KickBack ( 1, 0.375, 0.175, 0.0375, 5.75, 1.75, 8 );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:20,代码来源:weapon_ak47.cpp

示例10: GalilFire

void CWeaponGalil::GalilFire( float flSpread )
{
	if ( !CSBaseGunFire( flSpread, GetCSWpnData().m_flCycleTime, true ) )
		return;

	CCSPlayer *pPlayer = GetPlayerOwner();

	// CSBaseGunFire can kill us, forcing us to drop our weapon, if we shoot something that explodes
	if ( !pPlayer )
		return;

	if (pPlayer->GetAbsVelocity().Length2D() > 5)
		pPlayer->KickBack (1.0, 0.45, 0.28, 0.045, 3.75, 3, 7);
	else if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		pPlayer->KickBack (1.2, 0.5, 0.23, 0.15, 5.5, 3.5, 6);
	else if ( FBitSet( pPlayer->GetFlags(), FL_DUCKING ) )
		pPlayer->KickBack (0.6, 0.3, 0.2, 0.0125, 3.25, 2, 7);
	else
		pPlayer->KickBack (0.65, 0.35, 0.25, 0.015, 3.5, 2.25, 7);
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:20,代码来源:weapon_galil.cpp

示例11: PrimaryAttack

void CWeaponGalil::PrimaryAttack()
{
	CCSPlayer *pPlayer = GetPlayerOwner();
	if ( !pPlayer )
		return;

	// don't fire underwater
	if (pPlayer->GetWaterLevel() == 3)
	{
		PlayEmptySound( );
		m_flNextPrimaryAttack = gpGlobals->curtime + 0.15;
		return;
	}
	
	if ( !FBitSet( pPlayer->GetFlags(), FL_ONGROUND ) )
		GalilFire( 0.04f + 0.3f * m_flAccuracy );
	else if (pPlayer->GetAbsVelocity().Length2D() > 140)
		GalilFire( 0.04f + 0.07f * m_flAccuracy );
	else
		GalilFire( 0.0375f * m_flAccuracy );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:21,代码来源:weapon_galil.cpp

示例12: if

void CC4::PrimaryAttack()
{
	bool	PlaceBomb = false;
	CCSPlayer *pPlayer = GetPlayerOwner();


	int onGround = FBitSet( pPlayer->GetFlags(), FL_ONGROUND );

	if( m_bStartedArming == false )
	{
		if( pPlayer->m_bInBombZone && onGround )
		{
			m_bStartedArming = true;
			m_fArmedTime = gpGlobals->curtime + WEAPON_C4_ARM_TIME;
			m_bBombPlacedAnimation = false;
			//SendWeaponAnim( C4_ARM, UseDecrement() ? 1: 0 );

#if !defined( CLIENT_DLL )			
			// freeze the player in place while planting
			pPlayer->SetMaxSpeed( 1 );

			// player "arming bomb" animation
			pPlayer->SetAnimation( PLAYER_ATTACK1 );

			pPlayer->SetProgressBarTime( 3 );	
#endif
		}
		else
		{
			if ( !pPlayer->m_bInBombZone )
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Plant_At_Bomb_Spot");
			}
			else
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Plant_Must_Be_On_Ground");
			}

			m_flNextPrimaryAttack = gpGlobals->curtime + 1.0;
			return;
		}
	}
	else
	{
		if ( !onGround || !pPlayer->m_bInBombZone )
		{
			if( !pPlayer->m_bInBombZone )
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Arming_Cancelled" );
			}
			else
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Plant_Must_Be_On_Ground" );
			}

			m_flNextPrimaryAttack = gpGlobals->curtime + 1.5;
			m_bStartedArming = false;

#if !defined( CLIENT_DLL )
			// release the player from being frozen, we've somehow left the bomb zone
			pPlayer->ResetMaxSpeed();

			pPlayer->SetProgressBarTime( 0 );

			//pPlayer->SetAnimation( PLAYER_HOLDBOMB );

#endif
			/*
			if(m_bBombPlacedAnimation == true) //this means the placement animation is canceled
			{
				SendWeaponAnim( C4_DRAW, UseDecrement() ? 1: 0 );
			}
			else
			{
				SendWeaponAnim( C4_IDLE1, UseDecrement() ? 1: 0 );
			}
			*/
			
			return;
		}
		else
		{
			if( gpGlobals->curtime >= m_fArmedTime ) //the c4 is ready to be armed
			{
				//check to make sure the player is still in the bomb target area
				PlaceBomb = true;
			}
			else if( ( gpGlobals->curtime >= (m_fArmedTime - 0.75) ) && ( !m_bBombPlacedAnimation ) )
			{
				//call the c4 Placement animation 
				m_bBombPlacedAnimation = true;
				//SendWeaponAnim( C4_DROP, UseDecrement() ? 1: 0 );
				
#if !defined( CLIENT_DLL )
				// player "place" animation
				//pPlayer->SetAnimation( PLAYER_HOLDBOMB );
#endif
			}
		}
	}
//.........这里部分代码省略.........
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:101,代码来源:weapon_c4.cpp

示例13: if

void CC4::PrimaryAttack()
{
	bool	PlaceBomb = false;
	CCSPlayer *pPlayer = GetPlayerOwner();
	if ( !pPlayer )
		return;

	int onGround = FBitSet( pPlayer->GetFlags(), FL_ONGROUND );
	CBaseEntity *groundEntity = (onGround) ? pPlayer->GetGroundEntity() : NULL;
	if ( groundEntity )
	{
		// Don't let us stand on players, breakables, or pushaway physics objects to plant
		if ( groundEntity->IsPlayer() ||
			IsPushableEntity( groundEntity ) ||
#ifndef CLIENT_DLL
			IsBreakableEntity( groundEntity ) ||
#endif // !CLIENT_DLL
			IsPushAwayEntity( groundEntity ) )
		{
			onGround = false;
		}
	}

	if( m_bStartedArming == false && m_bBombPlanted == false )
	{
		if( pPlayer->m_bInBombZone && onGround )
		{
			m_bStartedArming = true;
			m_fArmedTime = gpGlobals->curtime + WEAPON_C4_ARM_TIME;
			m_bBombPlacedAnimation = false;


#if !defined( CLIENT_DLL )			
			// init the beep flags
			int i;
			for( i=0;i<NUM_BEEPS;i++ )
				m_bPlayedArmingBeeps[i] = false;

			// freeze the player in place while planting
			pPlayer->SetMaxSpeed( 1 );

			// player "arming bomb" animation
			pPlayer->SetAnimation( PLAYER_ATTACK1 );
	
			pPlayer->SetNextAttack( gpGlobals->curtime );

			IGameEvent * event = gameeventmanager->CreateEvent( "bomb_beginplant" );
			if( event )
			{
				event->SetInt("userid", pPlayer->GetUserID() );
				event->SetInt("site", pPlayer->m_iBombSiteIndex );
				event->SetInt( "priority", 8 );
				gameeventmanager->FireEvent( event );
			}
#endif

			SendWeaponAnim( ACT_VM_PRIMARYATTACK );

			FX_PlantBomb( pPlayer->entindex(), pPlayer->Weapon_ShootPosition() );
		}
		else
		{
			if ( !pPlayer->m_bInBombZone )
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Plant_At_Bomb_Spot");
			}
			else
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Plant_Must_Be_On_Ground");
			}

			m_flNextPrimaryAttack = gpGlobals->curtime + 1.0;
			return;
		}
	}
	else
	{
		if ( !onGround || !pPlayer->m_bInBombZone )
		{
			if( !pPlayer->m_bInBombZone )
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Arming_Cancelled" );
			}
			else
			{
				ClientPrint( pPlayer, HUD_PRINTCENTER, "#C4_Plant_Must_Be_On_Ground" );
			}

			m_flNextPrimaryAttack = gpGlobals->curtime + 1.5;
			m_bStartedArming = false;

#if !defined( CLIENT_DLL )
			// release the player from being frozen, we've somehow left the bomb zone
			pPlayer->ResetMaxSpeed();

			pPlayer->SetProgressBarTime( 0 );

			//pPlayer->SetAnimation( PLAYER_HOLDBOMB );

			IGameEvent * event = gameeventmanager->CreateEvent( "bomb_abortplant" );
//.........这里部分代码省略.........
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:101,代码来源:weapon_c4.cpp


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