本文整理汇总了C++中CBaseEntity::GetRenderColor方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntity::GetRenderColor方法的具体用法?C++ CBaseEntity::GetRenderColor怎么用?C++ CBaseEntity::GetRenderColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseEntity
的用法示例。
在下文中一共展示了CBaseEntity::GetRenderColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Event_Killed
//-----------------------------------------------------------------------------
// Purpose:
// Input : &info -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
void CNPC_CombineS::Event_Killed( const CTakeDamageInfo &info )
{
if (!(g_Language.GetInt() == LANGUAGE_GERMAN || UTIL_IsLowViolence()) && info.GetDamageType() & (DMG_BLAST | DMG_CRUSH) && !(info.GetDamageType() & (DMG_DISSOLVE)) && !PlayerHasMegaPhysCannon())
{
Vector vecDamageDir = info.GetDamageForce();
SpawnBlood(GetAbsOrigin(), g_vecAttackDir, BloodColor(), info.GetDamage());
DispatchParticleEffect("headshotspray", GetAbsOrigin(), GetAbsAngles(), this);
EmitSound("Gore.Headshot");
float flFadeTime = 25.0;
CGib::SpawnSpecificGibs(this, 1, 750, 1500, "models/gibs/soldier_head.mdl", flFadeTime);
Vector vecRagForce;
vecRagForce.x = random->RandomFloat(-400, 400);
vecRagForce.y = random->RandomFloat(-400, 400);
vecRagForce.z = random->RandomFloat(0, 250);
Vector vecRagDmgForce = (vecRagForce + vecDamageDir);
CBaseEntity *pLeftArmGib = CreateRagGib("models/gibs/soldier_left_arm.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pLeftArmGib)
{
color32 color = pLeftArmGib->GetRenderColor();
pLeftArmGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pRightArmGib = CreateRagGib("models/gibs/soldier_right_arm.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pRightArmGib)
{
color32 color = pRightArmGib->GetRenderColor();
pRightArmGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pTorsoGib = CreateRagGib("models/gibs/soldier_torso.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pTorsoGib)
{
color32 color = pTorsoGib->GetRenderColor();
pTorsoGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pPelvisGib = CreateRagGib("models/gibs/soldier_pelvis.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pPelvisGib)
{
color32 color = pPelvisGib->GetRenderColor();
pPelvisGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pLeftLegGib = CreateRagGib("models/gibs/soldier_left_leg.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pLeftLegGib)
{
color32 color = pLeftLegGib->GetRenderColor();
pLeftLegGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pRightLegGib = CreateRagGib("models/gibs/soldier_right_leg.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pRightLegGib)
{
color32 color = pRightLegGib->GetRenderColor();
pRightLegGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
//now add smaller gibs.
CGib::SpawnSpecificGibs(this, 3, 750, 1500, "models/gibs/pgib_p3.mdl", flFadeTime);
CGib::SpawnSpecificGibs(this, 3, 750, 1500, "models/gibs/pgib_p4.mdl", flFadeTime);
Vector forceVector = CalcDamageForceVector(info);
// Drop any weapon that I own
if (VPhysicsGetObject())
{
Vector weaponForce = forceVector * VPhysicsGetObject()->GetInvMass();
Weapon_Drop(m_hActiveWeapon, NULL, &weaponForce);
}
else
{
Weapon_Drop(m_hActiveWeapon);
}
if (info.GetAttacker()->IsPlayer())
{
((CSingleplayRules*)GameRules())->NPCKilled(this, info);
}
UTIL_Remove(this);
SetThink(NULL);
return;
}
// Don't bother if we've been told not to, or the player has a megaphyscannon
if ( combine_spawn_health.GetBool() == false || PlayerHasMegaPhysCannon() )
{
BaseClass::Event_Killed( info );
return;
}
//.........这里部分代码省略.........
示例2: Event_Killed
//-----------------------------------------------------------------------------
// Purpose:
// Input : &info -
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
void CNPC_CombineAce::Event_Killed( const CTakeDamageInfo &info )
{
if (!(g_Language.GetInt() == LANGUAGE_GERMAN || UTIL_IsLowViolence()) && info.GetDamageType() & (DMG_BLAST | DMG_CRUSH) && !(info.GetDamageType() & (DMG_DISSOLVE)) && !PlayerHasMegaPhysCannon())
{
Vector vecDamageDir = info.GetDamageForce();
SpawnBlood(GetAbsOrigin(), g_vecAttackDir, BloodColor(), info.GetDamage());
DispatchParticleEffect("headshotspray", GetAbsOrigin(), GetAbsAngles(), this);
EmitSound("Gore.Headshot");
float flFadeTime = 25.0;
CGib::SpawnSpecificGibs(this, 1, 750, 1500, "models/gibs/soldier_ace_head.mdl", flFadeTime);
Vector vecRagForce;
vecRagForce.x = random->RandomFloat(-400, 400);
vecRagForce.y = random->RandomFloat(-400, 400);
vecRagForce.z = random->RandomFloat(0, 250);
Vector vecRagDmgForce = (vecRagForce + vecDamageDir);
CBaseEntity *pLeftArmGib = CreateRagGib("models/gibs/soldier_ace_left_arm.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pLeftArmGib)
{
color32 color = pLeftArmGib->GetRenderColor();
pLeftArmGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pRightArmGib = CreateRagGib("models/gibs/soldier_ace_right_arm.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pRightArmGib)
{
color32 color = pRightArmGib->GetRenderColor();
pRightArmGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pTorsoGib = CreateRagGib("models/gibs/soldier_ace_torso.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pTorsoGib)
{
color32 color = pTorsoGib->GetRenderColor();
pTorsoGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pPelvisGib = CreateRagGib("models/gibs/soldier_ace_pelvis.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pPelvisGib)
{
color32 color = pPelvisGib->GetRenderColor();
pPelvisGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pLeftLegGib = CreateRagGib("models/gibs/soldier_ace_left_leg.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pLeftLegGib)
{
color32 color = pLeftLegGib->GetRenderColor();
pLeftLegGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
CBaseEntity *pRightLegGib = CreateRagGib("models/gibs/soldier_ace_right_leg.mdl", GetAbsOrigin(), GetAbsAngles(), vecRagDmgForce, flFadeTime, IsOnFire());
if (pRightLegGib)
{
color32 color = pRightLegGib->GetRenderColor();
pRightLegGib->SetRenderColor(color.r, color.g, color.b, color.a);
}
//now add smaller gibs.
CGib::SpawnSpecificGibs(this, 3, 750, 1500, "models/gibs/pgib_p3.mdl", flFadeTime);
CGib::SpawnSpecificGibs(this, 3, 750, 1500, "models/gibs/pgib_p4.mdl", flFadeTime);
if (!m_bNoArmor && combine_ace_shieldspawnmode.GetInt() > 0)
{
pArmor->Remove();
DropItem("item_shield", WorldSpaceCenter() + RandomVector(-4, 4), RandomAngle(0, 360));
}
Vector forceVector = CalcDamageForceVector(info);
// Drop any weapon that I own
if (VPhysicsGetObject())
{
Vector weaponForce = forceVector * VPhysicsGetObject()->GetInvMass();
Weapon_Drop(m_hActiveWeapon, NULL, &weaponForce);
}
else
{
Weapon_Drop(m_hActiveWeapon);
}
if (info.GetAttacker()->IsPlayer())
{
((CSingleplayRules*)GameRules())->NPCKilled(this, info);
}
UTIL_Remove(this);
SetThink(NULL);
return;
}
// Don't bother if we've been told not to, or the player has a megaphyscannon
//.........这里部分代码省略.........