这篇教程C++ GetMaxClip1函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetMaxClip1函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMaxClip1函数的具体用法?C++ GetMaxClip1怎么用?C++ GetMaxClip1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetMaxClip1函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: MIN//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CWeaponShotgun::ItemHolsterFrame( void ){ // Must be player held if ( GetOwner() && GetOwner()->IsPlayer() == false ) return; // We can't be active if ( GetOwner()->GetActiveWeapon() == this ) return; // If it's been longer than three seconds, reload if ( ( gpGlobals->curtime - m_flHolsterTime ) > sk_auto_reload_time.GetFloat() ) { // Reset the timer m_flHolsterTime = gpGlobals->curtime; if ( GetOwner() == NULL ) return; if ( m_iClip1 == GetMaxClip1() ) return; // Just load the clip with no animations int ammoFill = MIN( (GetMaxClip1() - m_iClip1), GetOwner()->GetAmmoCount( GetPrimaryAmmoType() ) ); GetOwner()->RemoveAmmo( ammoFill, GetPrimaryAmmoType() ); m_iClip1 += ammoFill; }}
开发者ID:NEITMod,项目名称:HL2BM2,代码行数:32,
示例2: GetPlayerOwnerbool CWeaponM4A1::Reload(){ CMomentumPlayer *pPlayer = GetPlayerOwner(); if (!pPlayer) return false; if (pPlayer->GetAmmoCount(GetPrimaryAmmoType()) <= 0) return false; int iResult = 0; if (m_bSilencerOn) iResult = DefaultReload(GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD_SILENCED); else iResult = DefaultReload(GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD); if (!iResult) return false; pPlayer->SetAnimation(PLAYER_RELOAD);#ifndef CLIENT_DLL if ((iResult) && (pPlayer->GetFOV() != pPlayer->GetDefaultFOV())) { pPlayer->SetFOV(pPlayer, pPlayer->GetDefaultFOV()); }#endif m_flAccuracy = 0.2; pPlayer->m_iShotsFired = 0; m_bDelayFire = false; return true;}
开发者ID:Asunaya,项目名称:game,代码行数:33,
示例3: GetOwner//-----------------------------------------------------------------------------// Purpose: Override so only reload one shell at a time// Input :// Output ://-----------------------------------------------------------------------------bool CWeapon870AE::StartReload( void ){ CBaseCombatCharacter *pOwner = GetOwner(); if ( pOwner == NULL ) return false; if (m_iItemID == 0) { if (pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0) return false; if (m_iClip1 >= GetMaxClip1()) return false; // If shotgun totally emptied then a pump animation is needed //NOTENOTE: This is kinda lame because the player doesn't get strong feedback on when the reload has finished, // without the pump. Technically, it's incorrect, but it's good for feedback... int j = MIN(1, pOwner->GetAmmoCount(m_iPrimaryAmmoType)); if (j <= 0) return false; } else { CBasePlayer *pPlayer = ToBasePlayer(GetOwner()); if (pPlayer) { if (pPlayer->Inventory_CountAllObjectContentsOfID(GetPrimaryAmmoID()) <= 0) return false; if (m_iClip1 >= GetMaxClip1()) return false; int j = MIN(1, pPlayer->Inventory_CountAllObjectContentsOfID(GetPrimaryAmmoID())); if (j <= 0) return false; } } SendWeaponAnim( ACT_SHOTGUN_RELOAD_START ); // Make shotgun shell visible SetBodygroup(1,0); pOwner->m_flNextAttack = gpGlobals->curtime; m_flNextPrimaryAttack = gpGlobals->curtime + SequenceDuration(); m_bInReload = true; return true;}
开发者ID:jherring137,项目名称:hl2_augmented,代码行数:57,
示例4: ToBasePlayer//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CWeaponCGuard::DelayedFire( void ){ if ( m_flChargeTime >= gpGlobals->curtime ) return; if ( m_bFired ) return; m_bFired = true; // Only the player fires this way so we can cast CBasePlayer *pPlayer = ToBasePlayer( GetOwner() ); if ( pPlayer == NULL ) return; // Abort here to handle burst and auto fire modes if ( (GetMaxClip1() != -1 && m_iClip1 == 0) || (GetMaxClip1() == -1 && !pPlayer->GetAmmoCount(m_iPrimaryAmmoType) ) ) return; // MUST call sound before removing a round from the clip of a CMachineGun WeaponSound(SINGLE); pPlayer->DoMuzzleFlash(); // To make the firing framerate independent, we may have to fire more than one bullet here on low-framerate systems, // especially if the weapon we're firing has a really fast rate of fire. if ( GetSequence() != SelectWeightedSequence( ACT_VM_PRIMARYATTACK ) ) { m_flNextPrimaryAttack = gpGlobals->curtime; } // Make sure we don't fire more than the amount in the clip, if this weapon uses clips if ( UsesClipsForAmmo1() ) { m_iClip1 = m_iClip1 - 1; } // Fire the bullets Vector vecSrc = pPlayer->Weapon_ShootPosition( ); Vector vecAiming = pPlayer->GetRadialAutoVector( NEW_AUTOAIM_RADIUS, NEW_AUTOAIM_DIST ); //Factor in the view kick AddViewKick(); Vector impactPoint = vecSrc + ( vecAiming * MAX_TRACE_LENGTH ); trace_t tr; UTIL_TraceHull( vecSrc, impactPoint, Vector( -2, -2, -2 ), Vector( 2, 2, 2 ), MASK_SHOT, pPlayer, COLLISION_GROUP_NONE, &tr ); CreateConcussiveBlast( tr.endpos, tr.plane.normal, this, 1.0 );}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:55,
示例5: Warning//-----------------------------------------------------------------------------// Purpose: Override so only reload one shell at a time// Input :// Output ://-----------------------------------------------------------------------------bool CWeapon870AE::Reload( void ){ // Check that StartReload was called first if (!m_bInReload) { Warning("ERROR: Shotgun Reload called incorrectly!/n"); } CBaseCombatCharacter *pOwner = GetOwner(); if (m_iItemID == 0) { if (pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0) return false; if (m_iClip1 >= GetMaxClip1()) return false; int j = MIN(1, pOwner->GetAmmoCount(m_iPrimaryAmmoType)); if (j <= 0) return false; } else { CBasePlayer *pPlayer = ToBasePlayer(GetOwner()); if (pPlayer) { if (pPlayer->Inventory_CountAllObjectContentsOfID(GetPrimaryAmmoID()) <= 0) return false; if (m_iClip1 >= GetMaxClip1()) return false; int j = MIN(1, pPlayer->Inventory_CountAllObjectContentsOfID(GetPrimaryAmmoID())); if (j <= 0) return false; } } FillClip(); // Play reload on different channel as otherwise steals channel away from fire sound WeaponSound(RELOAD); SendWeaponAnim( ACT_VM_RELOAD ); pOwner->m_flNextAttack = gpGlobals->curtime; m_flNextPrimaryAttack = gpGlobals->curtime + SequenceDuration(); return true;}
开发者ID:jherring137,项目名称:hl2_augmented,代码行数:53,
示例6: GetOwner//-----------------------------------------------------------------------------// Purpose: Same as base reload but doesn't change the owner's next attack time. This// lets us zoom out while reloading. This hack is necessary because our// ItemPostFrame is only called when the owner's next attack time has// expired.// Output : Returns true if the weapon was reloaded, false if no more ammo.//-----------------------------------------------------------------------------bool CWeaponSniperRifle::Reload( void ){ CBaseCombatCharacter *pOwner = GetOwner(); if (!pOwner) { return false; } if (pOwner->GetAmmoCount(m_iPrimaryAmmoType) > 0) { int primary = MIN(GetMaxClip1() - m_iClip1, pOwner->GetAmmoCount(m_iPrimaryAmmoType)); int secondary = MIN(GetMaxClip2() - m_iClip2, pOwner->GetAmmoCount(m_iSecondaryAmmoType)); if (primary > 0 || secondary > 0) { // Play reload on different channel as it happens after every fire // and otherwise steals channel away from fire sound WeaponSound(RELOAD); SendWeaponAnim( ACT_VM_RELOAD ); m_flNextPrimaryAttack = gpGlobals->curtime + SequenceDuration(); m_bInReload = true; } return true; } return false;}
开发者ID:SizzlingStats,项目名称:hl2sdk-ob-valve,代码行数:37,
示例7: GetPlayerOwnerbool CWeaponCSBaseGun::Reload(){ CCSPlayer *pPlayer = GetPlayerOwner(); if ( !pPlayer ) return false; if (pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0) return false; int iResult = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( !iResult ) return false; pPlayer->SetAnimation( PLAYER_RELOAD );#ifndef CLIENT_DLL if ((iResult) && (pPlayer->GetFOV() != pPlayer->GetDefaultFOV())) { pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV() ); }#endif m_flAccuracy = 0.2; pPlayer->m_iShotsFired = 0; m_bDelayFire = false; pPlayer->SetShieldDrawnState( false ); return true;}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:29,
示例8: GetOwner//-----------------------------------------------------------------------------// Purpose: Override so only reload one shell at a time// Input :// Output ://-----------------------------------------------------------------------------bool CWeaponShotgun::StartReload( void ){ if ( m_bNeedPump ) return false; CBaseCombatCharacter *pOwner = GetOwner(); if ( pOwner == NULL ) return false; if (pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0) return false; if (m_iClip1 >= GetMaxClip1()) return false; int j = MIN(1, pOwner->GetAmmoCount(m_iPrimaryAmmoType)); if (j <= 0) return false; SendWeaponAnim( ACT_SHOTGUN_RELOAD_START ); // Make shotgun shell visible SetBodygroup(1,0); pOwner->m_flNextAttack = gpGlobals->curtime; m_flNextPrimaryAttack = gpGlobals->curtime + SequenceDuration(); m_bInReload = true; return true;}
开发者ID:NEITMod,项目名称:HL2BM2,代码行数:38,
示例9: GetDODPlayerOwnerbool CDODBaseRocketWeapon::Reload( void ){ CDODPlayer *pPlayer = GetDODPlayerOwner(); if (pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0) { CDODPlayer *pDODPlayer = ToDODPlayer( pPlayer ); pDODPlayer->HintMessage( HINT_AMMO_EXHAUSTED ); return false; } Activity actReload; if( IsDeployed() ) actReload = ACT_VM_RELOAD_DEPLOYED; else actReload = ACT_VM_RELOAD; int iResult = DefaultReload( GetMaxClip1(), GetMaxClip2(), actReload ); if ( !iResult ) return false; pPlayer->SetAnimation( PLAYER_RELOAD ); // if we don't want the auto-rezoom, undeploy here if ( !pPlayer->ShouldAutoRezoom() ) { m_bDeployed = false; pPlayer->SetBazookaDeployed( m_bDeployed ); } return true;}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:33,
示例10: DefaultReload//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------bool CWeaponG43::Reload( void ){ bool fRet; float fCacheTime = m_flNextSecondaryAttack; fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { // Undo whatever the reload process has done to our secondary // attack timer. We allow you to interrupt reloading to fire // a grenade. m_flNextSecondaryAttack = GetOwner()->m_flNextAttack = fCacheTime; WeaponSound( RELOAD ); CBasePlayer *pOwner = ToBasePlayer( GetOwner() ); CEffectData data; data.m_vOrigin = pOwner->WorldSpaceCenter() + RandomVector( 0, 0 ); data.m_vAngles = QAngle( 90, random->RandomInt( 0, 360 ), 0 ); data.m_nEntIndex = entindex(); DispatchEffect( "ClipEject", data ); } return fRet;}
开发者ID:BerntA,项目名称:tfo-code,代码行数:28,
示例11: Warning//-----------------------------------------------------------------------------// Purpose: Override so only reload one shell at a time// Input :// Output ://-----------------------------------------------------------------------------bool CWeaponShotgun::Reload( void ){ // Check that StartReload was called first if (!m_bInReload) { Warning("ERROR: Shotgun Reload called incorrectly!/n"); } CBaseCombatCharacter *pOwner = GetOwner(); if ( pOwner == NULL ) return false; if (pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0) return false; if (m_iClip1 >= GetMaxClip1()) return false; int j = min(1, pOwner->GetAmmoCount(m_iPrimaryAmmoType)); if (j <= 0) return false; FillClip(); // Play reload on different channel as otherwise steals channel away from fire sound WeaponSound(RELOAD); SendWeaponAnim( ACT_VM_RELOAD ); pOwner->m_flNextAttack = gpGlobals->curtime; m_flNextPrimaryAttack = gpGlobals->curtime + SequenceDuration(); return true;}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:39,
示例12: DefaultReloadbool CWeaponSAA::Reload( void ){ bool fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) WeaponSound( RELOAD ); return fRet;}
开发者ID:dreckard,项目名称:dhl2,代码行数:7,
示例13: DefaultReload//Tony; override for animation purposes.bool CWeaponHL2MPBase::Reload( void ){ bool fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) {// WeaponSound( RELOAD ); ToHL2MPPlayer(GetOwner())->DoAnimationEvent( PLAYERANIMEVENT_RELOAD ); } return fRet;}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:11,
示例14: DefaultReload//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------bool CWeaponPistol::Reload( void ){ bool fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { WeaponSound( RELOAD ); m_flAccuracyPenalty = 0.0f; } return fRet;}
开发者ID:WorldGamers,项目名称:Mobile-Forces-Source,代码行数:12,
示例15: DefaultReload//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------bool CWeaponGlock18::Reload( void ){ bool fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { WeaponSound( RELOAD ); ToHL2MPPlayer(GetOwner())->DoAnimationEvent( PLAYERANIMEVENT_RELOAD ); m_flAccuracyPenalty = 0.0f; } return fRet;}
开发者ID:jonnyboy0719,项目名称:situation-outbreak-two,代码行数:13,
示例16: DefaultReload//-----------------------------------------------------------------------------// Purpose: The gun is being reloaded //-----------------------------------------------------------------------------bool CWeaponAK47::Reload( void ){ bool fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { WeaponSound( RELOAD ); ToHL2MPPlayer(GetOwner())->DoAnimationEvent( PLAYERANIMEVENT_RELOAD ); //reset the burst counter to the default m_iBurst=BURST; } return fRet;}
开发者ID:js564,项目名称:final,代码行数:15,
示例17: DefaultReload//-----------------------------------------------------------------------------// Purpose: The gun is being reloaded //-----------------------------------------------------------------------------bool CWeaponMomentumGun::Reload(void){ bool fRet = DefaultReload(GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD); if (fRet) { WeaponSound(RELOAD); //ToBaseCombatCharacter(GetOwner())->DoAnimationEvent(PLAYERANIMEVENT_RELOAD); //reset the burst counter to the default m_iBurst = BURST; } return fRet;}
开发者ID:EspyEspurr,项目名称:game,代码行数:15,
示例18: GetPlayerOwnerbool CWeaponShotgun::Reload(){ CSDKPlayer *pPlayer = GetPlayerOwner(); if (pPlayer->GetAmmoCount( m_iPrimaryAmmoType ) <= 0 || m_iClip1 == GetMaxClip1()) return true; // don't reload until recoil is done if (m_flNextPrimaryAttack > gpGlobals->curtime) return true; // check to see if we're ready to reload if (m_fInSpecialReload == 0) { pPlayer->SetAnimation( PLAYER_RELOAD ); SendWeaponAnim( ACT_SHOTGUN_RELOAD_START ); m_fInSpecialReload = 1; pPlayer->m_flNextAttack = gpGlobals->curtime + 0.5; m_flNextPrimaryAttack = gpGlobals->curtime + 0.5; m_flNextSecondaryAttack = gpGlobals->curtime + 0.5; SetWeaponIdleTime( gpGlobals->curtime + 0.5 ); return true; } else if (m_fInSpecialReload == 1) { if (m_flTimeWeaponIdle > gpGlobals->curtime) return true; // was waiting for gun to move to side m_fInSpecialReload = 2; SendWeaponAnim( ACT_VM_RELOAD ); SetWeaponIdleTime( gpGlobals->curtime + 0.45 ); } else { // Add them to the clip m_iClip1 += 1; #ifdef GAME_DLL SendReloadEvents();#endif CSDKPlayer *pPlayer = GetPlayerOwner(); if ( pPlayer ) pPlayer->RemoveAmmo( 1, m_iPrimaryAmmoType ); m_fInSpecialReload = 1; } return true;}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:53,
示例19: GetOwnerbool CWeaponShotgun::Reload( void ){ CBaseCombatCharacter *pOwner = GetOwner(); if ( pOwner == NULL ) return false; if ( pOwner->GetAmmoCount( m_iPrimaryAmmoType ) <= 0 ) return false; if ( m_iClip1 >= GetMaxClip1() ) return false; // don't reload until recoil is done if ( m_flNextPrimaryAttack > gpGlobals->curtime ) return false; // check to see if we're ready to reload if ( m_fInSpecialReload == 0 ) { SendWeaponAnim( ACT_SHOTGUN_RELOAD_START ); m_fInSpecialReload = 1; pOwner->m_flNextAttack = gpGlobals->curtime + 0.6; SetWeaponIdleTime( gpGlobals->curtime + 0.6 ); m_flNextPrimaryAttack = gpGlobals->curtime + 1.0; m_flNextSecondaryAttack = gpGlobals->curtime + 1.0; return true; } else if ( m_fInSpecialReload == 1 ) { if ( !HasWeaponIdleTimeElapsed() ) return false; // was waiting for gun to move to side m_fInSpecialReload = 2; // Play reload on different channel as otherwise steals channel away from fire sound WeaponSound( RELOAD ); SendWeaponAnim( ACT_VM_RELOAD ); SetWeaponIdleTime( gpGlobals->curtime + 0.5 ); } else { FillClip(); m_fInSpecialReload = 1; } return true;}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:52,
示例20: DefaultReloadbool CWeaponMosinNagant::Reload( void ){ bool fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { WeaponSound( RELOAD ); if ( m_bInZoom ) { ToggleZoom(); //DHL: Leave zoom at reload } } return fRet;}
开发者ID:dreckard,项目名称:dhl2,代码行数:13,
示例21: DefaultReload//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------bool CWeaponPistol::Reload( void ){ bool fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { WeaponSound( RELOAD );#ifdef HL2MP_DEV_DLL ToHL2MPPlayer(GetOwner())->DoAnimationEvent( PLAYERANIMEVENT_RELOAD );#endif // HL2MP_DEV_DLL m_flAccuracyPenalty = 0.0f; } return fRet;}
开发者ID:Baer42,项目名称:Source-SDK-2014,代码行数:15,
示例22: DefaultReload//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------bool CWeapon_HL2_SMG1::Reload( void ){ bool fRet; fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { WeaponSound( RELOAD ); ToRainbowPlayer(GetOwner())->DoAnimationEvent( PLAYERANIMEVENT_RELOAD ); } return fRet;}
开发者ID:DonnaLisa,项目名称:swarm-deferred,代码行数:16,
示例23: GetPlayerOwnerbool CWeaponDODBase::IsUseable(){ CBasePlayer *pPlayer = GetPlayerOwner(); if ( Clip1() <= 0 ) { if ( pPlayer->GetAmmoCount( GetPrimaryAmmoType() ) <= 0 && GetMaxClip1() != -1 ) { // clip is empty (or nonexistant) and the player has no more ammo of this type. return false; } } return true;}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:15,
示例24: DefaultReload//-----------------------------------------------------------------------------//-----------------------------------------------------------------------------bool CWeaponSMG1::Reload( void ){ bool fRet; float fCacheTime = m_flNextSecondaryAttack; fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { // Undo whatever the reload process has done to our secondary // attack timer. We allow you to interrupt reloading to fire // a grenade. m_flNextSecondaryAttack = GetOwner()->m_flNextAttack = fCacheTime; WeaponSound( RELOAD ); } return fRet;}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:20,
示例25: GetViewmodelBoneControllers//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CWeaponCombatBurstRifle::GetViewmodelBoneControllers( C_BaseViewModel *pViewModel, float controllers[MAXSTUDIOBONECTRLS]){ float flAmmoCount; C_BaseTFPlayer *pPlayer = ( C_BaseTFPlayer* )GetOwner(); if ( pPlayer && pPlayer->IsDamageBoosted() ) { flAmmoCount = random->RandomFloat( 0.0f, 1.0f ); } else { // Dial shows ammo count! flAmmoCount = ( float )m_iClip1 / ( float )GetMaxClip1(); } // Add some shake flAmmoCount += RandomFloat( -0.02, 0.02 ); controllers[0] = flAmmoCount;}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:22,
示例26: DefaultReloadbool CWeaponUzi::Reload( void ){ bool fRet; float fCacheTime = m_flNextSecondaryAttack; fRet = DefaultReload( GetMaxClip1(), GetMaxClip2(), ACT_VM_RELOAD ); if ( fRet ) { // Undo whatever the reload process has done to our secondary // attack timer. We allow you to interrupt reloading to fire // a grenade. m_flNextSecondaryAttack = GetOwner()->m_flNextAttack = fCacheTime; WeaponSound( RELOAD ); ToHL2MPPlayer(GetOwner())->DoAnimationEvent( PLAYERANIMEVENT_RELOAD ); } m_flNextPrimaryAttack = gpGlobals->curtime + 1,466666666666667; return fRet;}
开发者ID:Orygin,项目名称:BisounoursParty,代码行数:19,
示例27: ToTFPlayer//-----------------------------------------------------------------------------// Purpose: //-----------------------------------------------------------------------------void CTFRocketLauncher::ItemPostFrame( void ){ CTFPlayer *pOwner = ToTFPlayer( GetOwnerEntity() ); if ( !pOwner ) return; BaseClass::ItemPostFrame();#ifdef GAME_DLL if ( m_flShowReloadHintAt && m_flShowReloadHintAt < gpGlobals->curtime ) { if ( Clip1() < GetMaxClip1() ) { pOwner->HintMessage( HINT_SOLDIER_RPG_RELOAD ); } m_flShowReloadHintAt = 0; } /* Vector forward; AngleVectors( pOwner->EyeAngles(), &forward ); trace_t tr; CTraceFilterSimple filter( pOwner, COLLISION_GROUP_NONE ); UTIL_TraceLine( pOwner->EyePosition(), pOwner->EyePosition() + forward * 2000, MASK_SOLID, &filter, &tr ); if ( tr.m_pEnt && tr.m_pEnt->IsPlayer() && tr.m_pEnt->IsAlive() && tr.m_pEnt->GetTeamNumber() != pOwner->GetTeamNumber() ) { m_bLockedOn = true; } else { m_bLockedOn = false; } */#endif}
开发者ID:TenmaPL,项目名称:TF2Classic,代码行数:44,
示例28: GetMarinevoid CASW_Weapon::FinishReload( void ){ CASW_Marine *pOwner = GetMarine(); if (pOwner) { // If I use primary clips, reload primary if ( UsesClipsForAmmo1() ) { // asw: throw away what's in the clip currently m_iClip1 = 0; int primary = MIN( GetMaxClip1() - m_iClip1, pOwner->GetAmmoCount(m_iPrimaryAmmoType)); m_iClip1 += primary; pOwner->RemoveAmmo( primary, m_iPrimaryAmmoType); } // If I use secondary clips, reload secondary if ( UsesClipsForAmmo2() ) { int secondary = MIN( GetMaxClip2() - m_iClip2, pOwner->GetAmmoCount(m_iSecondaryAmmoType)); m_iClip2 += secondary; pOwner->RemoveAmmo( secondary, m_iSecondaryAmmoType ); } if ( m_bReloadsSingly ) { m_bInReload = false; }#ifdef GAME_DLL if ( !m_bFastReloadSuccess ) { pOwner->m_nFastReloadsInARow = 0; }#endif m_bFastReloadSuccess = false; m_bFastReloadFailure = false; }}
开发者ID:BenLubar,项目名称:riflemod,代码行数:39,
注:本文中的GetMaxClip1函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetMaxSkillValueForLevel函数代码示例 C++ GetMax函数代码示例 |