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


C++ UseDecrement函数代码示例

本文整理汇总了C++中UseDecrement函数的典型用法代码示例。如果您正苦于以下问题:C++ UseDecrement函数的具体用法?C++ UseDecrement怎么用?C++ UseDecrement使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: SendWeaponAnim

/* <2bae77> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:147 */
void CUSP::__MAKE_VHOOK(SecondaryAttack)(void)
{
	if (ShieldSecondaryFire(USP_SHIELD_UP, USP_SHIELD_DOWN))
	{
		return;
	}

	if (m_iWeaponState & WPNSTATE_USP_SILENCED)
	{
		m_iWeaponState &= ~WPNSTATE_USP_SILENCED;

		SendWeaponAnim(USP_DETACH_SILENCER, UseDecrement() != FALSE);
		Q_strcpy(m_pPlayer->m_szAnimExtention, "onehanded");
	}
	else
	{
		m_iWeaponState |= WPNSTATE_USP_SILENCED;

		SendWeaponAnim(USP_ATTACH_SILENCER, UseDecrement() != FALSE);
		Q_strcpy(m_pPlayer->m_szAnimExtention, "onehanded");
	}

	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0;
	m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 3.0;
	m_flNextPrimaryAttack = GetNextAttackDelay(3.0);
}
开发者ID:Adidasman1,项目名称:ReGameDLL_CS,代码行数:27,代码来源:wpn_usp.cpp

示例2: ResetEmptySound

void CFiveSeven::WeaponIdle( void )
{
    ResetEmptySound();
    m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );

    if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() )
    {
        return;
    }

    if( m_pPlayer->HasShield() )
    {
        m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0;

        if( FBitSet( m_iWeaponState, WPNSTATE_SHIELD_DRAWN ) )
        {
            SendWeaponAnim( SHIELDGUN_DRAWN_IDLE, UseDecrement() != FALSE );
        }
    }
    else if( m_iClip )
    {
        m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0625;
        SendWeaponAnim( FIVESEVEN_IDLE, UseDecrement() != FALSE );
    }
}
开发者ID:Chuvi-w,项目名称:CSSDK,代码行数:25,代码来源:wpn_fiveseven.cpp

示例3: ResetEmptySound

void CM3::WeaponIdle(void)
{
	ResetEmptySound();
	m_pPlayer->GetAutoaimVector(AUTOAIM_5DEGREES);

	if (m_flPumpTime && m_flPumpTime < UTIL_WeaponTimeBase())
		m_flPumpTime = 0;

	if (m_flTimeWeaponIdle < UTIL_WeaponTimeBase())
	{
		if (m_iClip == 0 && m_fInSpecialReload == 0 && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
		{
			Reload();
		}
		else if (m_fInSpecialReload != 0)
		{
			if (m_iClip != M3_MAX_CLIP && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
			{
				Reload();
			}
			else
			{
				SendWeaponAnim(M3_PUMP, UseDecrement() != FALSE);

				m_fInSpecialReload = 0;
				m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.5;
			}
		}
		else
			SendWeaponAnim(M3_IDLE, UseDecrement() != FALSE);
	}
}
开发者ID:DeadlyGamer,项目名称:cs16nd,代码行数:32,代码来源:wpn_m3.cpp

示例4: ResetEmptySound

/* <2b9c2a> ../cstrike/dlls/wpn_shared/wpn_usp.cpp:318 */
void CUSP::__MAKE_VHOOK(WeaponIdle)(void)
{
	ResetEmptySound();
	m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);
	
	if (m_flTimeWeaponIdle > 0)
	{
		return;
	}

	if (m_pPlayer->HasShield())
	{
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20.0;

		if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN)
		{
			SendWeaponAnim(USP_DRAW, UseDecrement());
		}
	}
	else if (m_iClip)
	{
		int iAnim = (~m_iWeaponState & WPNSTATE_USP_SILENCED) ? USP_UNSIL_IDLE: USP_IDLE;

		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60.0;
		SendWeaponAnim(iAnim, UseDecrement());
	}
}
开发者ID:Adidasman1,项目名称:ReGameDLL_CS,代码行数:28,代码来源:wpn_usp.cpp

示例5: ResetEmptySound

void CUSP::WeaponIdle(void)
{
	ResetEmptySound();
	m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);

	if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
		return;

	if (m_pPlayer->HasShield())
	{
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20;

		if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN)
			SendWeaponAnim(USP_DRAW, UseDecrement() != FALSE);

		return;
	}

	if (m_iClip)
	{
		m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 60;

		if (m_iWeaponState & WPNSTATE_USP_SILENCED)
			SendWeaponAnim(USP_IDLE, UseDecrement() != FALSE);
		else
			SendWeaponAnim(USP_UNSIL_IDLE, UseDecrement() != FALSE);
	}
}
开发者ID:DeadlyGamer,项目名称:cs16nd,代码行数:28,代码来源:wpn_usp.cpp

示例6: GetNextAttackDelay

/* <2464c1> ../cstrike/dlls/wpn_shared/wpn_c4.cpp:358 */
void CC4::__MAKE_VHOOK(WeaponIdle)(void)
{
	if (m_bStartedArming)
	{
		// if the player releases the attack button cancel the arming sequence
		m_bStartedArming = false;

		// release the player from being frozen
		m_pPlayer->ResetMaxSpeed();

		m_flNextPrimaryAttack = GetNextAttackDelay(1.0);
		m_pPlayer->SetProgressBarTime(0);

		// this means the placement animation is canceled
		if (m_bBombPlacedAnimation)
			SendWeaponAnim(C4_DRAW, UseDecrement() != FALSE);
		else
			SendWeaponAnim(C4_IDLE1, UseDecrement() != FALSE);
	}

	if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase())
	{
		if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
		{
			RetireWeapon();
			return;
		}

		SendWeaponAnim(C4_DRAW, UseDecrement() != FALSE);
		SendWeaponAnim(C4_IDLE1, UseDecrement() != FALSE);
	}
}
开发者ID:Adidasman1,项目名称:ReGameDLL_CS,代码行数:33,代码来源:wpn_c4.cpp

示例7: SendWeaponAnim

bool CSmokeGrenade::ShieldSecondaryFire(int up_anim, int down_anim)
{
	if (m_pPlayer->HasShield() == false)
		return false;

	if (m_flStartThrow > 0)
		return false;

	if (m_iWeaponState & WPNSTATE_SHIELD_DRAWN)
	{
		m_iWeaponState &= ~WPNSTATE_SHIELD_DRAWN;
		SendWeaponAnim(down_anim, UseDecrement() != FALSE);
		strcpy(m_pPlayer->m_szAnimExtention, "shieldgren");
		m_fMaxSpeed = 250;
		m_pPlayer->m_bShieldDrawn = false;
	}
	else
	{
		m_iWeaponState |= WPNSTATE_SHIELD_DRAWN;
		SendWeaponAnim(up_anim, UseDecrement() != FALSE);
		strcpy(m_pPlayer->m_szAnimExtention, "shielded");
		m_fMaxSpeed = 180;
		m_pPlayer->m_bShieldDrawn = true;
	}

   m_pPlayer->UpdateShieldCrosshair((m_iWeaponState & WPNSTATE_SHIELD_DRAWN) == 0);
	m_pPlayer->ResetMaxSpeed();

	m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 0.4;
	m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.4;
	m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 0.6;
	return true;
}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:33,代码来源:wpn_smokegrenade.cpp

示例8: SendWeaponAnim

void CXM1014::Reload()
{
	if (m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0 || m_iClip == iMaxClip())
		return;

	// don't reload until recoil is done
	if (m_flNextPrimaryAttack > UTIL_WeaponTimeBase())
		return;

	// check to see if we're ready to reload
	if (m_fInSpecialReload == 0)
	{
		m_pPlayer->SetAnimation(PLAYER_RELOAD);
		SendWeaponAnim(XM1014_START_RELOAD, UseDecrement() != FALSE);

		m_fInSpecialReload = 1;
		m_flNextSecondaryAttack = m_flTimeWeaponIdle = m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.55f;
		m_flNextPrimaryAttack = GetNextAttackDelay(0.55);
	}
	else if (m_fInSpecialReload == 1)
	{
		if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
			return;

		// was waiting for gun to move to side
		m_fInSpecialReload = 2;

		if (RANDOM_LONG(0, 1))
			EMIT_SOUND_DYN(m_pPlayer->edict(), CHAN_ITEM, "weapons/reload1.wav", VOL_NORM, ATTN_NORM, 0, 85 + RANDOM_LONG(0, 31));
		else
			EMIT_SOUND_DYN(m_pPlayer->edict(), CHAN_ITEM, "weapons/reload3.wav", VOL_NORM, ATTN_NORM, 0, 85 + RANDOM_LONG(0, 31));

		SendWeaponAnim(XM1014_RELOAD, UseDecrement());

		m_flTimeWeaponIdle = m_flNextReload = UTIL_WeaponTimeBase() + 0.3f;
	}
	else
	{
		m_iClip++;

#ifdef REGAMEDLL_ADD
		if (refill_bpammo_weapons.value < 3.0f)
#endif
		{
			m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
			m_pPlayer->ammo_buckshot--;
		}

		m_fInSpecialReload = 1;
	}
}
开发者ID:s1lentq,项目名称:ReGameDLL_CS,代码行数:51,代码来源:wpn_xm1014.cpp

示例9: ResetEmptySound

void CM4A1::WeaponIdle(void)
{
    ResetEmptySound();
    m_pPlayer->GetAutoaimVector(AUTOAIM_10DEGREES);

    if (m_flTimeWeaponIdle > UTIL_WeaponTimeBase())
        return;

    m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 20;

    if (m_iWeaponState & WPNSTATE_M4A1_SILENCED)
        SendWeaponAnim(M4A1_IDLE, UseDecrement() != FALSE);
    else
        SendWeaponAnim(M4A1_UNSIL_IDLE, UseDecrement() != FALSE);
}
开发者ID:LAxBANDA,项目名称:cs16nd,代码行数:15,代码来源:wpn_m4a1.cpp

示例10: DefaultDeploy

BOOL CMP5N::Deploy()
{
    m_iShotsFired = 0;
    m_fDelayFire  = FALSE;

    return DefaultDeploy( "models/v_mp5.mdl", "models/p_mp5.mdl", MP5N_DRAW, "mp5", UseDecrement() );
}
开发者ID:johndrinkwater,项目名称:CSSDK,代码行数:7,代码来源:wpn_mp5navy.cpp

示例11: ResetEmptySound

void CUSP::WeaponIdle()
{
    ResetEmptySound();

    m_pPlayer->GetAutoaimVector( AUTOAIM_10DEGREES );

    if( m_flTimeWeaponIdle > UTIL_WeaponTimeBase() )
    {
        return;
    }

    if( m_pPlayer->HasShield() )
    {
        m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + USP_IDLE_INTERVAL;

        if( FBitSet( m_fWeaponState, WEAPONSTATE_SHIELD_DRAWN ) )
        {
            SendWeaponAnim( GUN_IDLE1, UseDecrement() );
        }
    }
    else if( m_iClip )
    {
        m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + USP_IDLE_INTERVAL_NOSHIELD;
        SendWeaponAnim( USP_IDLE_UNSIL * !FBitSet( m_fWeaponState, WEAPONSTATE_USP_SILENCED ), UseDecrement() );
    }
}
开发者ID:johndrinkwater,项目名称:CSSDK,代码行数:26,代码来源:wpn_usp.cpp

示例12: ClearBits

void CUSP::SecondaryAttack()
{
    if( ShieldSecondaryFire( GUN_SHIELD_UP, GUN_SHIELD_DOWN ) )
    {
        return;
    }

    int anim;

    if( FBitSet( m_fWeaponState, WEAPONSTATE_USP_SILENCED ) )
    {
        ClearBits( m_fWeaponState, WEAPONSTATE_USP_SILENCED );
        anim = USP_DETACH_SILENCER;
    }
    else
    {
        SetBits( m_fWeaponState, WEAPONSTATE_USP_SILENCED );
        anim = USP_ADD_SILENCER;
    }

    SendWeaponAnim( anim, UseDecrement() );

    strcpy( m_pPlayer->m_szAnimExtention, "onehanded" );

    m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + 3.0;
    m_flNextPrimaryAttack   = UTIL_WeaponTimeBase() + 3.0;
    m_flTimeWeaponIdle      = UTIL_WeaponTimeBase() + 3.0;
}
开发者ID:johndrinkwater,项目名称:CSSDK,代码行数:28,代码来源:wpn_usp.cpp

示例13: DefaultDeploy

BOOL CSG552::__MAKE_VHOOK(Deploy)()
{
	m_flAccuracy = 0.2f;
	m_iShotsFired = 0;
	iShellOn = 1;

	return DefaultDeploy("models/v_sg552.mdl", "models/p_sg552.mdl", SG552_DRAW, "mp5", UseDecrement() != FALSE);
}
开发者ID:Solexid,项目名称:ReGameDLL_CS,代码行数:8,代码来源:wpn_sg552.cpp

示例14: DefaultDeploy

BOOL CM249::Deploy(void)
{
	m_flAccuracy = 0.2;
	m_iShotsFired = 0;
	iShellOn = 1;

	return DefaultDeploy("models/v_m249.mdl", "models/p_m249.mdl", M249_DRAW, "m249", UseDecrement() != FALSE);
}
开发者ID:jeefo,项目名称:cs16-client,代码行数:8,代码来源:wpn_m249.cpp

示例15: DefaultDeploy

BOOL CMP5N::__MAKE_VHOOK(Deploy)()
{
	m_flAccuracy = 0.0f;
	m_bDelayFire = false;
	iShellOn = 1;

	return DefaultDeploy("models/v_mp5.mdl", "models/p_mp5.mdl", MP5N_DRAW, "mp5", UseDecrement() != FALSE);
}
开发者ID:Solexid,项目名称:ReGameDLL_CS,代码行数:8,代码来源:wpn_mp5navy.cpp


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