本文整理汇总了C++中CTFPlayer::RemoveInvisibility方法的典型用法代码示例。如果您正苦于以下问题:C++ CTFPlayer::RemoveInvisibility方法的具体用法?C++ CTFPlayer::RemoveInvisibility怎么用?C++ CTFPlayer::RemoveInvisibility使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTFPlayer
的用法示例。
在下文中一共展示了CTFPlayer::RemoveInvisibility方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: StartBuilding
//-----------------------------------------------------------------------------
// Purpose: Player holding this weapon has started building something
// Assumes we are in a valid build position
//-----------------------------------------------------------------------------
void CTFWeaponBuilder::StartBuilding( void )
{
CTFPlayer *pPlayer = ToTFPlayer( GetOwner() );
CBaseObject *pObj = m_hObjectBeingBuilt.Get();
if ( pPlayer && pPlayer->m_Shared.IsCarryingObject() )
{
Assert( pObj );
pObj->RedeployBuilding( ToTFPlayer( GetOwner() ) );
m_hObjectBeingBuilt = NULL;
pPlayer->m_Shared.SetCarriedObject( NULL );
return;
}
Assert( pObj );
pObj->StartBuilding( GetOwner() );
pObj->AddSpawnFlags( SF_OBJ_UPGRADABLE );
m_hObjectBeingBuilt = NULL;
if ( pPlayer )
{
pPlayer->RemoveInvisibility();
}
}
示例2: StartBuilding
//-----------------------------------------------------------------------------
// Purpose: Player holding this weapon has started building something
// Assumes we are in a valid build position
//-----------------------------------------------------------------------------
void CTFWeaponBuilder::StartBuilding( void )
{
CBaseObject *pObj = m_hObjectBeingBuilt.Get();
Assert( pObj );
pObj->StartBuilding( GetOwner() );
m_hObjectBeingBuilt = NULL;
CTFPlayer *pPlayer = ToTFPlayer( GetOwner() );
if ( pPlayer )
{
pPlayer->RemoveInvisibility();
}
}
示例3: StartBuilding
//-----------------------------------------------------------------------------
// Purpose: Player holding this weapon has started building something
// Assumes we are in a valid build position
//-----------------------------------------------------------------------------
void CTFWeaponBuilder::StartBuilding( void )
{
CTFPlayer *pPlayer = ToTFPlayer( GetOwner() );
CBaseObject *pObj = m_hObjectBeingBuilt.Get();
if ( pPlayer && pPlayer->m_Shared.IsCarryingObject() )
{
Assert( pObj );
pObj->DropCarriedObject( pPlayer );
}
Assert( pObj );
pObj->StartBuilding( GetOwner() );
m_hObjectBeingBuilt = NULL;
if ( pPlayer )
{
pPlayer->RemoveInvisibility();
}
}
示例4: PrimaryAttack
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFWeaponBaseGun::PrimaryAttack( void )
{
// Check for ammunition.
if ( m_iClip1 <= 0 && m_iClip1 != -1 )
return;
// Are we capable of firing again?
if ( m_flNextPrimaryAttack > gpGlobals->curtime )
return;
// Get the player owning the weapon.
CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
if ( !pPlayer )
return;
if ( !CanAttack() )
return;
CalcIsAttackCritical();
#ifndef CLIENT_DLL
pPlayer->RemoveInvisibility();
pPlayer->RemoveDisguise();
// Minigun has custom handling
if ( GetWeaponID() != TF_WEAPON_MINIGUN )
{
pPlayer->SpeakWeaponFire();
}
CTF_GameStats.Event_PlayerFiredWeapon( pPlayer, IsCurrentAttackACrit() );
#endif
// Set the weapon mode.
m_iWeaponMode = TF_WEAPON_PRIMARY_MODE;
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
pPlayer->SetAnimation( PLAYER_ATTACK1 );
FireProjectile( pPlayer );
m_flLastFireTime = gpGlobals->curtime;
// Set next attack times.
m_flNextPrimaryAttack = gpGlobals->curtime + m_pWeaponInfo->GetWeaponData( m_iWeaponMode ).m_flTimeFireDelay;
// Don't push out secondary attack, because our secondary fire
// systems are all separate from primary fire (sniper zooming, demoman pipebomb detonating, etc)
//m_flNextSecondaryAttack = gpGlobals->curtime + m_pWeaponInfo->GetWeaponData( m_iWeaponMode ).m_flTimeFireDelay;
// Set the idle animation times based on the sequence duration, so that we play full fire animations
// that last longer than the refire rate may allow.
if ( Clip1() > 0 )
{
SetWeaponIdleTime( gpGlobals->curtime + SequenceDuration() );
}
else
{
SetWeaponIdleTime( gpGlobals->curtime + SequenceDuration() );
}
// Check the reload mode and behave appropriately.
if ( m_bReloadsSingly )
{
m_iReloadMode.Set( TF_RELOAD_START );
}
}
示例5: PrimaryAttack
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFWeaponBaseGun::PrimaryAttack( void )
{
// Check for ammunition.
if ( m_iClip1 <= 0 && UsesClipsForAmmo1() )
return;
// Get the player owning the weapon.
CTFPlayer *pPlayer = ToTFPlayer( GetPlayerOwner() );
if ( !pPlayer )
return;
if ( !CanAttack() )
return;
if ( m_pWeaponInfo->GetWeaponData( TF_WEAPON_PRIMARY_MODE ).m_nBurstSize > 0 && m_iBurstSize == 0 )
{
// Start the burst.
m_iBurstSize = m_pWeaponInfo->GetWeaponData( TF_WEAPON_PRIMARY_MODE ).m_nBurstSize;
}
if ( m_iBurstSize > 0 )
{
m_iBurstSize--;
}
CalcIsAttackCritical();
#ifndef CLIENT_DLL
pPlayer->RemoveInvisibility();
pPlayer->RemoveDisguise();
// Minigun has custom handling
if ( GetWeaponID() != TF_WEAPON_MINIGUN )
{
pPlayer->SpeakWeaponFire();
}
CTF_GameStats.Event_PlayerFiredWeapon( pPlayer, IsCurrentAttackACrit() );
#endif
// Set the weapon mode.
m_iWeaponMode = TF_WEAPON_PRIMARY_MODE;
SendWeaponAnim( ACT_VM_PRIMARYATTACK );
pPlayer->SetAnimation( PLAYER_ATTACK1 );
FireProjectile( pPlayer );
m_flLastFireTime = gpGlobals->curtime;
// Set next attack times.
float flFireDelay = m_pWeaponInfo->GetWeaponData( m_iWeaponMode ).m_flTimeFireDelay;
CALL_ATTRIB_HOOK_FLOAT( flFireDelay, mult_postfiredelay );
m_flNextPrimaryAttack = gpGlobals->curtime + flFireDelay;
// Don't push out secondary attack, because our secondary fire
// systems are all separate from primary fire (sniper zooming, demoman pipebomb detonating, etc)
//m_flNextSecondaryAttack = gpGlobals->curtime + m_pWeaponInfo->GetWeaponData( m_iWeaponMode ).m_flTimeFireDelay;
// Set the idle animation times based on the sequence duration, so that we play full fire animations
// that last longer than the refire rate may allow.
SetWeaponIdleTime( gpGlobals->curtime + SequenceDuration() );
AbortReload();
}