• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetMarine函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: RemoveWeldingEffects

void CASW_Weapon_Welder::UpdateDoorWeldingEffects( void )
{
	if ( !m_bIsFiring || !GetMarine() || !GetMarine()->GetMarineResource() )
	{
		RemoveWeldingEffects();
		StopWelderSound();
		return;
	}

	C_ASW_Door* pDoor = GetMarine()->GetMarineResource()->m_hWeldingDoor.Get();
	if ( !pDoor || pDoor->IsOpen() )
	{
		RemoveWeldingEffects();
		StopWelderSound();
		return;
	}

	StartWelderSound();

	if ( !m_hWeldEffects || m_bWeldSealLast != m_bWeldSeal )
	{
		CreateWeldingEffects( pDoor );
	}

	if ( m_hWeldEffects )
	{
		m_hWeldEffects->SetControlPoint( 0, pDoor->GetWeldFacingPoint( GetMarine() ) );
		m_hWeldEffects->SetControlPointForwardVector( 0, pDoor->GetSparkNormal( GetMarine() ) );
	}

	m_bWeldSealLast = m_bWeldSeal;
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:32,代码来源:asw_weapon_welder_shared.cpp


示例2: MarineSkills

int CASW_Weapon_Assault_Shotgun::GetNumPellets()
{
	if (GetMarine())
		return MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_VINDICATOR, ASW_MARINE_SUBSKILL_VINDICATOR_PELLETS);

	return GetWeaponInfo()->m_iNumPellets;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:7,代码来源:asw_weapon_assault_shotgun_shared.cpp


示例3: OffhandActivate

bool CASW_Weapon_Medkit::OffhandActivate()
{
	if (!GetMarine() || GetMarine()->GetFlags() & FL_FROZEN)	// don't allow this if the marine is frozen
		return false;
	SelfHeal();

	return true;
}
开发者ID:jtanx,项目名称:ch1ckenscoop,代码行数:8,代码来源:asw_weapon_medkit_shared.cpp


示例4: OffhandActivate

bool CASW_Weapon_Buff_Grenade::OffhandActivate()
{
	if (!GetMarine() || GetMarine()->GetFlags() & FL_FROZEN)	// don't allow this if the marine is frozen
		return false;
	PrimaryAttack();

	return true;
}
开发者ID:jtanx,项目名称:ch1ckenscoop,代码行数:8,代码来源:asw_weapon_buff_grenade.cpp


示例5: return

bool CASW_Weapon_Shotgun::ShouldUseFastReloadAnim()
{
	if (GetMarine())
	{
		return (MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_RELOADING) < 1.06f);		
	}
	return true;
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:8,代码来源:asw_weapon_shotgun_shared.cpp


示例6: OffhandActivate

bool CASW_Weapon_Stim::OffhandActivate()
{	
	if (!GetMarine() || GetMarine()->GetFlags() & FL_FROZEN)	// don't allow this if the marine is frozen
		return false;

	if (m_flNextPrimaryAttack < gpGlobals->curtime)
		PrimaryAttack();

	return true;
}
开发者ID:BenLubar,项目名称:riflemod,代码行数:10,代码来源:asw_weapon_stim_shared.cpp


示例7: GetWeaponInfo

float CASW_Weapon_Sniper_Rifle::GetWeaponDamage()
{
	float flDamage = GetWeaponInfo()->m_flBaseDamage;

	if ( GetMarine() )
	{
		flDamage += MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_ACCURACY, ASW_MARINE_SUBSKILL_ACCURACY_SNIPER_RIFLE_DMG);
	}

	return flDamage;
}
开发者ID:BenLubar,项目名称:riflemod,代码行数:11,代码来源:asw_weapon_sniper_rifle.cpp


示例8: GetWeaponInfo

float CASW_Weapon_Autogun::GetWeaponDamage()
{
	float flDamage = GetWeaponInfo()->m_flBaseDamage;

	if ( GetMarine() )
	{
		flDamage += MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_AUTOGUN, ASW_MARINE_SUBSKILL_AUTOGUN_DMG);
	}

	return flDamage;
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:11,代码来源:asw_weapon_autogun_shared.cpp


示例9: GetWeaponInfo

float CASW_Weapon_Shotgun::GetWeaponDamage()
{
	float flDamage = GetWeaponInfo()->m_flBaseDamage;

	if ( GetMarine() )
	{
		flDamage += MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_ACCURACY, ASW_MARINE_SUBSKILL_ACCURACY_SHOTGUN_DMG);
	}

	//CALL_ATTRIB_HOOK_FLOAT( flDamage, mod_damage_done );

	return flDamage;
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:13,代码来源:asw_weapon_shotgun_shared.cpp


示例10: GetWeaponInfo

float CASW_Weapon_Minigun::GetWeaponDamage()
{
	//float flDamage = 7.0f;
	float flDamage = GetWeaponInfo()->m_flBaseDamage;

	if ( GetMarine() )
	{
		flDamage += MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_AUTOGUN, ASW_MARINE_SUBSKILL_AUTOGUN_DMG);
	}

	//CALL_ATTRIB_HOOK_FLOAT( flDamage, mod_damage_done );

	return flDamage;
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:14,代码来源:asw_weapon_minigun.cpp


示例11: GetWeaponInfo

float CASW_Weapon_Assault_Shotgun::GetWeaponDamage()
{
	//float flDamage = 7.0f;
	float flDamage = GetWeaponInfo()->m_flBaseDamage;

	if ( GetMarine() )
	{
		flDamage += MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_VINDICATOR, ASW_MARINE_SUBSKILL_VINDICATOR_DAMAGE);
	}

	//CALL_ATTRIB_HOOK_FLOAT( flDamage, mod_damage_done );

	return flDamage;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:14,代码来源:asw_weapon_assault_shotgun_shared.cpp


示例12: GetCommander

const QAngle& CASW_Weapon_Smart_Bomb::GetRocketAngle()
{
	static QAngle angRocket = vec3_angle;
	CASW_Player *pPlayer = GetCommander();
	CASW_Marine *pMarine = GetMarine();
	if ( !pPlayer || !pMarine || pMarine->GetHealth() <= 0 )
	{
		return angRocket;
	}

	//Vector vecDir = pPlayer->GetAutoaimVectorForMarine(pMarine, GetAutoAimAmount(), GetVerticalAdjustOnlyAutoAimAmount());	// 45 degrees = 0.707106781187
	//VectorAngles( vecDir, angRocket );
	//angRocket[ YAW ] += random->RandomFloat( -35, 35 );
	angRocket[ PITCH ] = -60.0f;	// aim up to help avoid FF
	if ( GetRocketsToFire() % 2 )
	{
		angRocket[ YAW ] = m_iRocketsToFire * 15.0f;	// 15 degrees between each rocket
	}
	else
	{
		angRocket[ YAW ] = RandomFloat( 0.0f, 360.0f );
	}
	angRocket[ ROLL ] = 0;
	return angRocket;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:25,代码来源:asw_weapon_smart_bomb.cpp


示例13: GetMarine

float	CASW_Weapon_Pistol::GetFireRate( void )
{
	CASW_Marine *pMarine = GetMarine();

	float flRate = GetWeaponInfo()->m_flFireRate;

	// player firing rate
	if (!pMarine || pMarine->IsInhabited())
	{
		return flRate;
	}

#ifdef CLIENT_DLL
	return flRate;

#else
	float randomness = 0.1f * random->RandomFloat() - 0.05f;

	// AI firing rate: depends on distance to enemy
	if (!pMarine->GetEnemy())
		return 0.3f + randomness;

	float dist = pMarine->GetAbsOrigin().DistTo(pMarine->GetEnemy()->GetAbsOrigin());
	if (dist > 500)
		return 0.3f + randomness;

	if (dist < 100)
		return 0.14f + randomness;

	float factor = (dist - 100) / 400.0f;
	return 0.14f + factor * 0.16f + randomness;
#endif
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:33,代码来源:asw_weapon_pistol_shared.cpp


示例14: GetCommander

void CASW_Weapon_Hornet_Barrage::FireRocket()
{
	CASW_Player *pPlayer = GetCommander();
	CASW_Marine *pMarine = GetMarine();
	if ( !pPlayer || !pMarine || pMarine->GetHealth() <= 0 )
	{
		m_iRocketsToFire = 0;
		return;
	}

	WeaponSound(SINGLE);

	// tell the marine to tell its weapon to draw the muzzle flash
	pMarine->DoMuzzleFlash();

	pMarine->DoAnimationEvent( PLAYERANIMEVENT_FIRE_GUN_PRIMARY );

	Vector vecSrc	 = GetRocketFiringPosition();
	m_iRocketsToFire = m_iRocketsToFire.Get() - 1;
	m_flNextLaunchTime = gpGlobals->curtime + m_flFireInterval.Get();

#ifndef CLIENT_DLL
	float fGrenadeDamage = MarineSkills()->GetSkillBasedValueByMarine(pMarine, ASW_MARINE_SKILL_GRENADES, ASW_MARINE_SUBSKILL_GRENADE_HORNET_DMG );

	CASW_Rocket::Create( fGrenadeDamage, vecSrc, GetRocketAngle(), pMarine, this );

	if ( ASWGameRules() )
	{
		ASWGameRules()->m_fLastFireTime = gpGlobals->curtime;
	}

	pMarine->OnWeaponFired( this, 1 );

#endif
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:35,代码来源:asw_weapon_hornet_barrage.cpp


示例15: IsCarriedByLocalPlayer

const char *CASW_Weapon::GetASWShootSound( int iIndex, int &iPitch )
{
	if ( iIndex == SINGLE || iIndex == SINGLE_NPC )
	{
		iIndex = IsCarriedByLocalPlayer() ? SINGLE : SINGLE_NPC;
	}

	if ( iIndex == WPN_DOUBLE || iIndex == DOUBLE_NPC )
	{
		iIndex = IsCarriedByLocalPlayer() ? WPN_DOUBLE : DOUBLE_NPC;
	}

	if ( iIndex == RELOAD || iIndex == RELOAD_NPC )
	{
		iIndex = IsCarriedByLocalPlayer() ? RELOAD : RELOAD_NPC;

		// play the weapon sound according to marine skill
		int iSkill = MarineSkills()->GetSkillBasedValueByMarine(GetMarine(), ASW_MARINE_SKILL_RELOADING, ASW_MARINE_SUBSKILL_RELOADING_SOUND);
		switch (iSkill)
		{
		case 5: return GetWpnData().aShootSounds[ FAST_RELOAD ]; break;
		case 4: iPitch = 120; return GetWpnData().aShootSounds[ iIndex ]; break;
		case 3: iPitch = 115; return GetWpnData().aShootSounds[ iIndex ]; break;
		case 2: iPitch = 110; return GetWpnData().aShootSounds[ iIndex ]; break;
		case 1: iPitch = 105; return GetWpnData().aShootSounds[ iIndex ]; break;
		default: return GetWpnData().aShootSounds[ iIndex ]; break;
		};
	}
	return GetShootSound( iIndex );
}
开发者ID:BenLubar,项目名称:riflemod,代码行数:30,代码来源:asw_weapon_shared.cpp


示例16: GetMarine

void CASW_Weapon_Sniper_Rifle::ItemPostFrame( void )
{
	BaseClass::ItemPostFrame();

	CASW_Marine *pMarine = GetMarine();
	if ( !pMarine )
		return;

	// AIs switch out of zoom mode
	if ( !pMarine->IsInhabited() && IsZoomed() )
	{
		m_bZoomed = false;
	}

	bool bAttack1, bAttack2, bReload, bOldReload, bOldAttack1;
	GetButtons( bAttack1, bAttack2, bReload, bOldReload, bOldAttack1 );

	bool bOldAttack2 = false;
	if ( pMarine->IsInhabited() && pMarine->GetCommander() )
	{
		bOldAttack2 = !!(pMarine->m_nOldButtons & IN_ATTACK2);
	}

	if ( bAttack2 && !bOldAttack2 )
	{
		m_bZoomed = !IsZoomed();
	}
}
开发者ID:BenLubar,项目名称:riflemod,代码行数:28,代码来源:asw_weapon_sniper_rifle.cpp


示例17: GetMarine

void CASW_Weapon_Blink::DoBlink()
{
	CASW_Marine *pMarine = GetMarine();
	if ( !pMarine )
		return;

	pMarine->m_iJumpJetting = JJ_BLINK;
	pMarine->m_vecJumpJetStart = pMarine->GetAbsOrigin();
	pMarine->m_vecJumpJetEnd = m_vecAbilityDestination;
	pMarine->m_flJumpJetStartTime = gpGlobals->curtime;
	pMarine->m_flJumpJetEndTime = gpGlobals->curtime + asw_blink_time.GetFloat();

	ASWMeleeSystem()->StartMeleeAttack( ASWMeleeSystem()->GetMeleeAttackByName( "Blink" ), pMarine, ASWGameMovement()->GetMoveData() );

	// TODO:
	/*
#ifdef GAME_DLL
	// create a small stun volume at the start
	CASW_Weapon_EffectVolume *pEffect = (CASW_Weapon_EffectVolume*) CreateEntityByName("asw_weapon_effect_volume");
	if ( pEffect )
	{
		pEffect->SetAbsOrigin( pMarine->GetAbsOrigin() );
		pEffect->SetOwnerEntity( pMarine );
		pEffect->SetOwnerWeapon( NULL );
		pEffect->SetEffectFlag( ASW_WEV_ELECTRIC_BIG );
		pEffect->SetDuration( pSkill->GetValue( CASW_Skill_Details::Duration, GetSkillPoints() ) );
		pEffect->Spawn();
	}
#endif
	*/

	m_flPower = 0.0f;

	// TODO: Check for charges being zero
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:35,代码来源:asw_weapon_blink.cpp


示例18: GetMarine

void CASW_Weapon_Chainsaw::CreateEffect( void )
{
#ifndef CLIENT_DLL    
	CASW_Marine *pMarine = GetMarine();
	if ( !pMarine )
	{
		return;
	}

	DestroyEffect();

	m_hBeam = CBeam::BeamCreate( ASW_CHAINSAW_BEAM_SPRITE, 1.75 );
	m_hBeam->PointEntInit( GetAbsOrigin(), this );
	m_hBeam->SetBeamFlags( FBEAM_SINENOISE );
	m_hBeam->SetEndAttachment( 1 );
	m_hBeam->AddSpawnFlags( SF_BEAM_TEMPORARY );	// Flag these to be destroyed on save/restore or level transition
	m_hBeam->SetOwnerEntity( pMarine );
	m_hBeam->SetScrollRate( 10 );
	m_hBeam->SetBrightness( 200 );
	m_hBeam->SetColor( 255, 255, 255 );
	m_hBeam->SetNoise( 0.025 );

	m_hNoise = CBeam::BeamCreate( ASW_CHAINSAW_BEAM_SPRITE, 2.5 );
	m_hNoise->PointEntInit( GetAbsOrigin(), this );
	m_hNoise->SetEndAttachment( 1 );
	m_hNoise->AddSpawnFlags( SF_BEAM_TEMPORARY );
	m_hNoise->SetOwnerEntity( pMarine );
	m_hNoise->SetScrollRate( 25 );
	m_hNoise->SetBrightness( 200 );
	m_hNoise->SetColor( 255, 255, 255 );
	m_hNoise->SetNoise( 0.8 );
#endif    
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:33,代码来源:asw_weapon_chainsaw_shared.cpp


示例19: GetMarine

bool CASW_Weapon::DestroyIfEmpty( bool bDestroyWhenActive, bool bCheckSecondaryAmmo )
{
	CASW_Marine *pMarine = GetMarine();
	if ( !pMarine )
		return false;

	bool bActive = (pMarine->GetActiveASWWeapon() == this);
	if ( bActive && !bDestroyWhenActive )
		return false;

	if ( bCheckSecondaryAmmo && (m_iClip2 || pMarine->GetAmmoCount(m_iSecondaryAmmoType) > 0) )
		return false;

	if ( !m_iClip1 && pMarine->GetAmmoCount(m_iPrimaryAmmoType) <= 0)
	{
#ifndef CLIENT_DLL
		if (pMarine)
		{
			pMarine->Weapon_Detach(this);
			if (bActive)
				pMarine->SwitchToNextBestWeapon(NULL);
		}
		Kill();
		return true;
#endif
	}
	return false;
}
开发者ID:TalonBraveInfo,项目名称:InvasionASSource,代码行数:28,代码来源:asw_weapon.cpp


示例20: GetMarine

float CASW_Weapon_Hornet_Barrage::GetRocketFireInterval()
{
	CASW_Marine *pMarine = GetMarine();
	if ( !pMarine )
		return 0.5f;

	return MarineSkills()->GetSkillBasedValueByMarine(pMarine, ASW_MARINE_SKILL_GRENADES, ASW_MARINE_SUBSKILL_GRENADE_HORNET_INTERVAL );
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:8,代码来源:asw_weapon_hornet_barrage.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetMaterial函数代码示例发布时间:2022-05-30
下一篇:
C++ GetMapId函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap