當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetMarine函數代碼示例

本文整理匯總了C++中GetMarine函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetMarine函數的具體用法?C++ GetMarine怎麽用?C++ GetMarine使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetMarine函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的GetMarine函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。